[Tex/LaTex] When to use math mode

best practicesmath-mode

In my document, the numbers inside math mode appear differently than those numbers out. Sometimes, I have numbers like "10 squared" within a paragraph, so it seems useful to use $10^2$. However, maybe on the same line, I have "10 km". The style of the 10 is different. In this case, should I also use $10$ km?

  • Is there a general rule for when it is best to use math mode within a document?

Best Answer

Don Knuth touched on this topic in his article for TUGboat -- "Typesetting Concrete Mathematics". His examples don't include units (for that, the siunitx package is a good choice, as already mentioned), but the method for determining what is math and what isn't is well illustrated otherwise.

(The article is set in Knuth's Concrete fonts, and shows some of the special techniques used in setting that book. Irrelevant for this question, but interesting nonetheless.)