TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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
up vote 10 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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