6

The TeX syntax highlighter that I use colors all occurrences of a number followed by " in", e.g. 0 in or 32 in in a dangerous bright red, in almost all contexts. Why?

  • 9
    Probably it interprets this as "32 inches". What editor are you using? – egreg Oct 30 '11 at 15:33
  • @egreg: vim and the syntax files that came with it for Ubuntu 11.10. You seem to be right by the way: it also highlights "32 pt", "32 em" and "32in". – Tim N Oct 30 '11 at 15:35
  • @egreg: That's a solid answer to this question. – Werner Oct 30 '11 at 15:53
10

I don't know about Vim and its TeX/LaTeX syntax parser. It probably uses some rule that interprets a number followed by one of the keywords in pt cm mm em ex (and maybe also the other units of measure accepted by TeX) as denoting lengths; this is usually good, but it fails in situations such as

There are 42 books on the shelf and still 32 in the box

My flavor of Emacs+AUCTeX (Aquamacs) doesn't do this: it highlights lengths only in the argument of \setlength and \addtolength.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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