12

My girlfriend showed me dimensions in LaTeX documents typeset like this : \hspace{1,5cm} instead of what I would have thought was the correct \hspace{1.5cm} (we are french).

It seems that both syntaxes are understood by TeX and LaTeX engines even without internationalization packages.

Can you explain to me why it is so ? Did D. Knuth thought about this at the very beginning of is project, or is this more recent ?

Thanks for any pointer.

\bye

  • Never heard of that. May be it is done at the editor level? – Bernard May 24 at 23:06
  • Nope, works everywhere. – Nicolas FRANCOIS May 24 at 23:11
  • 2
    This feature was added into TeX on 23 Dec 1982, according to the TeX error log. – ShreevatsaR May 25 at 6:51
17

tex accepts . or , in its number syntax at the core level it doesn't need any packages it has always been this way.

If you look in the WEB (Pascal) source code of TeX the Progam you find

@d continental_point_token=other_token+"," {decimal point, Eurostyle}
| improve this answer | |
  • 3
    I've learnt something today! Thanks! – Bernard May 24 at 23:21
  • So have I 😋 Thanks, @David – Nicolas FRANCOIS May 24 at 23:45
  • @NicolasFRANCOIS Nonetheless the core support (+1 for the answer) my suggestion is that it will be better if you get used to typing always dots and only dots, or things as \usepackage[margin=2.5cm]{geometry} will not work. – Fran May 25 at 4:10
  • 1
    @Fran well as always with keyval: values in commas have to be braced so it's not that it wouldn't work, but the syntax would be margin={2,5cm} – David Carlisle May 25 at 7:53
  • 1
    @DavidCarlisle But that means double work: type the braces, and remember to type the braces. :) – Fran May 25 at 9:07

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.