tut: Text Multi-Line
(return to Cartography Tutorials page)
Creating Multi-Line Labels using VBScript
By default, Labels created in ArcMap are on a single line. Labels can be broken into multiple lines using Label Expressions. By default, Expressions are created using VBScript (Visual Basic). See below for notes on using Python.
Using Expressions
In the Layer Properties dialog box, choose the Labels tab and click the Expression... button
First we'll build a simple expression using two fields (joined with the & symbol)
Note that the results lack a space between the two fields...
This can be corrected by adding a string of text between the two fields. Text strings need to have double (full) quotes around them: i.e., "some text"
Adding Custom Text to a Label Expression
Alternatively, we can add a Line Feed (or Carriage Return) between the two fields.
Breaking a Label into Multiple Lines
VBnewline is short for Visual Basic New Line (note that VBLF also works, short for VB Line Feed, as does VBCR, short for VB Carriage Return)
Stacking labels and custom text additions can be combined:
Note that the above examples have been using VBScript (Visual Basic Script). You can accomplish similar results using Python or JScript.
Multi-Line Labels Using Python
To use Python, choose Python from the Parser drop-down menu at the bottom of the Label Expression dialog box (the default is VBScript)
To combine multiple labels, use the + symbol (instead of the &):
[STATE_NAME] + [POP2000]
To add custom text use the + and a text string (note text string is in double quotes) :
[STATE_NAME] + " " + [POP2000]
"The name of this state is " + [STATE_NAME]
To add a line feed use '\n' (note the single quotes):
[STATE_NAME] + '\n' + [POP2000]
(return to Cartography Tutorials page)