2

Intuitively, given the default math font in LaTeX is different from the body text in general, the numerals should be different too.

But from the documents, the difference does not show up or not very clear.

I guess it is also very important to notice, how this varies across different document classes. Especially, the beamer and the default LaTeX cases. Any help?

  • 4
    In the default latex font setup digits come from the font used for \mathrm which is the same as the default roman font so they are the same but you should always use math in case the font changes or you need $-1$ which is not same as -1 . This is a duplicate, i'll see if I can find.... – David Carlisle Aug 17 '16 at 9:21
  • Your "given" isn't really - it's true in some templates, and it is always possible, but in many cases they're the same – Chris H Aug 17 '16 at 9:21
  • 1
6

Instead of answering the broad question of how math fonts vary from text fonts across document classes, here's a way you can see which fonts are used.

\showoutput inserts the page construction details in your .log, including the choice of fonts. The minimal example

\documentclass{article}

\showoutput% Show output page construction

\begin{document}

-1

$-1$

\end{document}

shows in the .log the choice of encoding and fonts:

....\OT1/cmr/m/n/10 -
....\OT1/cmr/m/n/10 1
....
....\mathon
....\OMS/cmsy/m/n/10 ^^@
....\OT1/cmr/m/n/10 1
....\mathoff

The font used for 1 and $1$ are the same, but not for - and $-$. Similarly, the following minimal example (loading a different font via cfr-lm)

\documentclass{article}

\showoutput% Show output page construction
\usepackage{cfr-lm}

\begin{document}

-1

$-1$

\end{document}

shows in the .log the choice of encoding and fonts:

....\T1/clm2j/m/n/10 -
....\T1/clm2j/m/n/10 1
....
....\mathon
....\OMS/lmsy/m/n/10 ^^@
....\OT1/lmr/m/n/10 1
....\mathoff
| improve this answer | |
  • Thanks very much! I appreciate your kind & perfect answer that answers beyond the limited, unclear scope of my question. +1 and accepted. – Loves Probability Aug 18 '16 at 4:04
  • @LovesProbability This isn't a good example because clm2j is actually the same font as lmr in the sense that they use the same type1 font file. However, they are different fonts in the TeX sense (use different TFMs and one uses a VF) . The numerals are different even though they come from the same font because that font features 4 different styles of numerals and 2j indicates proportional, hanging figures, whereas lmr is using tabular, lining ones. clm would give the same figures as lmr, if I remember the code correctly. – cfr Aug 23 '16 at 23:22

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.