You are here:
Mapping and visualization
>
Adding graphics and text to maps
>
Working with text
About text formatting tags
ArcGIS text formatting tags let you modify the formatting for a portion of a piece of text. This lets you create mixed-format text where, for example, one word in a sentence is underlined. Text formatting tags can be used almost anywhere text is placed on or around the map in ArcMap. You can use the tags anywhere you can specify both a text string and a text symbol. For example, you can use tags in dynamic label expressions, annotation, legend text, map titles, and in the values of fields used to label features. Tags aren't resolved by the ArcMap table of contents, Table window, or Identify Results window, so tags added to field values will be visible as tags in those windows.
View a table of the text formatting tags available in ArcMap.
Tag syntax
The following syntax rules apply to formatting tags in ArcMap.
- The ArcGIS text formatting tags adhere to XML syntax rules. Each start tag must be accompanied by an end tag. Tags can be nested, but you must close the inner tag before closing an outer tag:
<BOL><UND>Text</UND></BOL>
The case of tag pairs must match exactly. Therefore, <BOL>...</BOL> is valid, as is <bol>...</bol>, but <Bol>...</bol> is invalid.
Tag attributes may be surrounded by either single or double quotes. The following two statements are equivalent:
<FNT name='Arial' size='18'>My text</FNT>
<FNT name="Arial" size="18">My text</FNT>
Any unrecognized, balanced tag pairs will be ignored by the parser. For example, even though <notag> is not a valid ArcGIS formatting tag, the following string is valid and will display properly: <notag><BOL>State College<BOL></notag>
& and < are special characters and are not valid in your text if formatting tags are used. Use the equivalent character codes & and < instead. For example, instead of <ITA>John & Paul</ITA>, use <ITA>John & Paul</ITA>.
Every piece of text on a map has a symbol that is used when it is drawn. Formatting tags work by temporarily modifying this base text symbol and drawing the specified portion of the text with the formatting specified in the tag. The buttons and commands on the Draw toolbar and in the Symbol Selector always reflect the properties of the base text symbol for the selected piece of text and do not reflect modifications made using formatting tags. For example, if you use the <FNT> tag to change the font of a piece of text, the Font menu on the Draw toolbar will not reflect this change when this text is selected on the map; it will show you the font of the text's base symbol. Text formatting tags can be used for any legend text; however, they are most useful for legend descriptions. Descriptions are extra pieces of textual information for a layer symbology class that can appear on the legend but do not appear in the table of contents.
Tags have no effect on a piece of text if they simply repeat an existing property of the base text symbol. Generally, this behavior is intuitive; for example, if you have a <BOL> tag in your text string, but the base text symbol is already bold, then the <BOL> tag in your string will have no effect. Also, because tags follow the rules of XML, it would be illegal to try and use a </BOL> tag to turn off the bold property of a base text symbol. Instead, you can use the <_BOL> tag for this purpose.
You can include formatting tags in label expressions.
Learn more about building label expressions
How to use text formatting tags in map document annotation and graphic text
Adding formatted text
- Click the Text button
on the Draw toolbar.
- Click the mouse pointer over the map display and type the text string.
As you type formatting tags into the string, you will see the tags as plain text on the display.
- Press Enter.
The formatted text appears on the display.
- If the string you enter has any syntax problems, formatting will be disabled and all the tags will appear as plain text on the display. To correct syntax errors, edit the text by double-clicking it with the Select Element tool
or clicking the Text button and clicking once inside the text.
- If you are creating geodatabase annotation text, use the tools on the Annotation toolbar.
Learn more about creating new annotation features
|
Editing formatted text
- Click the Select Elements tool
on the Draw toolbar and double-click the text element you want to edit.
The original text is shown below:
- Modify the text shown in the Text box on the Text tab.
Formatting tags will appear as plain text.
- Click Apply or OK to apply your changes and see any formatting changes on the display.
In this example, italic formatting tags have been added to the word "north":
- If you have geodatabase annotation, use the ArcMap editing tools to edit your annotation strings.
Learn more about editing geodatabase annotation
- With geodatabase annotation, the Attributes dialog box has a formatted preview and lets you create mixed-format text without entering tag syntax.
|
Adding mixed-format text to legend descriptions
- Symbolize your layer by choosing a symbology option that supports class descriptions, for example, unique values, graduated colors, or graduated symbols.
- Edit the class descriptions and enter some formatted text.
- Click OK on the Layer Properties dialog box to apply the symbology to your layer.
- Switch to layout view.
- Click the Insert menu and click Legend. Follow the steps in the Legend Wizard.
A legend is inserted onto your page with formatted text in the class descriptions.
- Edit the descriptions on the Symbology tab if desired and click Apply.
The legend will automatically update.
Please visit the
Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.