# Comma as a decimal separator in (La)TeX dimensions

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? May 24, 2020 at 23:06
• Nope, works everywhere. May 24, 2020 at 23:11
• This feature was added into TeX on 23 Dec 1982, according to the TeX error log. May 25, 2020 at 6:51

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}

• I've learnt something today! Thanks! May 24, 2020 at 23:21
• So have I 😋 Thanks, @David May 24, 2020 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, 2020 at 4:10
• @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} May 25, 2020 at 7:53
• @DavidCarlisle But that means double work: type the braces, and remember to type the braces. :)
– Fran
May 25, 2020 at 9:07