2

I have a labeling expression using two attributes I want the first one to be size 14 and the second one to be on a new line and be size 8. This was my attempt so far:

"<FNT name='Arial' size='14'>" & [Sec_Unit_L] & "</FNT>" + "\n" + "<FNT name='Arial' size='8'>" & [TWP_Label] & "</FNT>"

I get the following error message

enter image description here

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked May 31, 2017 at 23:38
2
  • 1
    Are you using the python or VB parser? Your question says python but your concatenation is VB. Commented May 31, 2017 at 23:39
  • Welcome to GIS SE! As a new user please take the tour to learn about our focused Q&A format. Commented May 31, 2017 at 23:41

1 Answer 1

3

There are a few formatting tags for ArcGIS, in either python or VB parser they are the same:

In VB:

"<FNT size='14'>" & [Sec_Unit_L] & "</FNT>" + vbnewline + "<FNT size='8'>" & [TWP_Label] & "</FNT>"

In Python:

"<FNT size='14'>{}</FNT>\n<FNT size='8'>{}</FNT>".format([Sec_Unit_L],[TWP_Label])

Whenever you open an enclosure you must close it, in this case <FNT XXX> matches a closing </FNT> otherwise the opening enclosure doesn't change the text but gets printed in the label.

answered May 31, 2017 at 23:45
2
  • Thank you so much, I think I confusing myself by using a bit VB in a Python expression. Thanks again Commented Jun 1, 2017 at 15:10
  • @rockycove The best way to say "thanks" here is to upvote and/or accept the answer. See What should I do when someone answers my question? Commented Jun 3, 2017 at 15:23

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.