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

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.
    – Midavalo
    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.

2
  • Thank you so much, I think I confusing myself by using a bit VB in a Python expression. Thanks again
    – rockycove
    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?
    – Midavalo
    Commented Jun 3, 2017 at 15:23

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.