16

Here is an example to consider:

A $3.1415$ approximation for $\pi$ was known on 314 BC?

Or maybe

A 3.1415 approximation for $\pi$ was known on 314 BC?

And here is another:

We run 32 experiments, the average result was always 42\%

etc.

lockstep
  • 250,273
Yossi Gil
  • 15,951

2 Answers2

16

I’ve started always using \num{123.45} from the siunitx package.

This has the advantage that the numbers are internally processed so you can globally adapt the style of those numbers using the \sisetup command. For example, you could later on decide whether to display the numbers in the text style or in the math style.

Furthermore, you can effortlessly control how exponential numbers are displayed and you can easily fit the numbers with units, too: \SI{12.34}{\second\per\meter}.

However, I don’t use this for all numbers: page numbers, for example, are never math (“see pages 12–32”). Likewise for years, or more generally dates (“1st of January …”), chapter numbers and so on. Basically anything that looks slightly ordinal.

Konrad Rudolph
  • 39,394
  • 22
  • 107
  • 160
5

Correct is $3.1415$ or $\numprint{3.1415}$ with the numprint package, with babel in french we have \nombre{3.1415}$. $3.1415$ is a number (mathematical object) and not a collection of digits. There are other packages to print correctly numbers. You need to separate content and form.

diabonas
  • 25,784
Alain Matthes
  • 95,075
  • But $314$\,BC and $32$ would be wrong? – Christian Lindig Apr 10 '11 at 11:25
  • I'm not a great expert in typography 314 BC is a collection of symbols and the size and the font are not the same of the math mode. For 32, I have a problem, logically you need to write : thirty-two experiments, so I think it's better to write 32 but I think we should avoid writing this. For 42\%perhaps siunitx can do this very well. – Alain Matthes Apr 10 '11 at 11:49
  • There is no difference in writing 1.234 or $1.234$ as long as one uses a corresponding math font, e.g. mathpazo instead of palatino –  Apr 10 '11 at 12:51
  • yes but it's better to use numprint or siunitx or a macro from babel to write correctly a number. The other difference is to show the content: 06 82 67 42 11 is for the telephone and not for the math. I agree with you There is no difference in writing 1.234 or $1.234$ as long as ... and this is why I prefer use $..$ to see the content. I see a math number and not symbols. – Alain Matthes Apr 10 '11 at 12:58
  • @Altermundus : no, the frenchb.ldf file provides \nombre but this macro does not display a number alla numprint, it just warns the user: Package frenchb.ldf Warning: \nombre now relies on package numprint.sty – unbonpetit Apr 10 '11 at 18:35
  • @unbonpetit: yes and no! My english is not very accurate or precise (I don't know the exact word) I know that \nombre now use numprint but I meant that it was another macro to write a number and not to print a phone number ( bad word in english !). With older version of frenchb \nombre was independent of numprint – Alain Matthes Apr 10 '11 at 18:46