Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Should I typeset numbers in a running text with math mode?

I read $4795$ pages.

I read 4705 pages.

I tried it out with the default font, and there does seem to be tiny differences in kerning. That could just be my imagination, though.

share|improve this question
    
The difference will be very visible for text fonts with old-style numbers (e.g. Linux Libertine). –  Caramdir May 26 '12 at 0:11
    
see the answer to the question [old-style-figures-use-in-references-brackets-e-g-to-equations-bibliography](htt‌​p://tex.stackexchange.com/questions/50825/) which quotes from a tugboat article by donald knuth regarding the difference between "math" and "non-math" numbers. the answer contains a link to the tugboat article. –  barbara beeton May 26 '12 at 22:01
add comment

1 Answer

up vote 10 down vote accepted

Here's a minimal document

\documentclass{article}
\begin{document}
\showboxbreadth=100 \showboxdepth=100

\sbox0{I read $4795$ pages. AV}\showbox0

\sbox0{I read 4795 pages. AV}\showbox0
\end{document}

In the log file we can see the result of the \showbox commands; I added AV just to show how kerning is displayed.

> \box0=
\hbox(6.94444+1.94444)x97.58348
.\OT1/cmr/m/n/10 I
.\glue 3.33333 plus 1.66498 minus 1.11221
.\OT1/cmr/m/n/10 r
.\OT1/cmr/m/n/10 e
.\OT1/cmr/m/n/10 a
.\OT1/cmr/m/n/10 d
.\glue 3.33333 plus 1.66666 minus 1.11111
.\mathon
.\OT1/cmr/m/n/10 4
.\OT1/cmr/m/n/10 7
.\OT1/cmr/m/n/10 9
.\OT1/cmr/m/n/10 5
.\mathoff
.\glue 3.33333 plus 1.66666 minus 1.11111
.\OT1/cmr/m/n/10 p
.\OT1/cmr/m/n/10 a
.\OT1/cmr/m/n/10 g
.\OT1/cmr/m/n/10 e
.\OT1/cmr/m/n/10 s
.\OT1/cmr/m/n/10 .
.\glue 4.44444 plus 4.99997 minus 0.37036
.\OT1/cmr/m/n/10 A
.\kern-1.11113
.\OT1/cmr/m/n/10 V


! OK.
l.5 \sbox0{I read $4795$ pages. AV}\showbox0

? 
> \box0=
\hbox(6.94444+1.94444)x97.58348
.\OT1/cmr/m/n/10 I
.\glue 3.33333 plus 1.66498 minus 1.11221
.\OT1/cmr/m/n/10 r
.\OT1/cmr/m/n/10 e
.\OT1/cmr/m/n/10 a
.\OT1/cmr/m/n/10 d
.\glue 3.33333 plus 1.66666 minus 1.11111
.\OT1/cmr/m/n/10 4
.\OT1/cmr/m/n/10 7
.\OT1/cmr/m/n/10 9
.\OT1/cmr/m/n/10 5
.\glue 3.33333 plus 1.66666 minus 1.11111
.\OT1/cmr/m/n/10 p
.\OT1/cmr/m/n/10 a
.\OT1/cmr/m/n/10 g
.\OT1/cmr/m/n/10 e
.\OT1/cmr/m/n/10 s
.\OT1/cmr/m/n/10 .
.\glue 4.44444 plus 4.99997 minus 0.37036
.\OT1/cmr/m/n/10 A
.\kern-1.11113
.\OT1/cmr/m/n/10 V

! OK.
l.7 \sbox0{I read 4795 pages. AV}\showbox0

? 

The two boxes are exactly the same except for the \mathon and \mathoff items that may add a kern if \mathsurround is nonzero.

You can see that the digits are taken from the same font. This is important in case other settings are chosen, for example Euler digits.

Write in math numbers that are intended in their mathematical sense. Page numbers or years, for instance, are "words".

share|improve this answer
add comment

Your Answer

 
discard

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.