2

For an online Moodle test I want to type numbers like \(0,1040\) where the decimal separator would be a comma and not a dot (à la French). How can I get rid of the space between the comma and the first decimal digit without any package?

Dimitris
  • 1,405
  • 4
    Enclose the comma in a pair of curly brackets: \(0{,}1040\). This works with (La)TeX. If Moodle does not actually use real (La)TeX as a backend to produce the output, but rather uses MathJax or something similar this may or may not work. – moewe May 21 '20 at 15:01
  • @moewe Merci. i will give it a try! – Dimitris May 22 '20 at 12:46
  • 1
    Related/duplicate? https://tex.stackexchange.com/questions/303110/avoid-space-after-commas-used-as-thousands-separator-in-math-mode – Steven B. Segletes Jun 21 '20 at 00:23
  • 1
    Consider that the things between \( \) or $ ... $ are passed directly to MathJax, so it depends more on MathJax than LaTeX... like https://stackoverflow.com/questions/45173530/mathjax-commas-in-digits, although I have no idea how to put that in the XML output... – Rmano Jun 26 '20 at 08:12

1 Answers1

3

You probably want icomma package.

It allows you to put a space after a comma only if there is the actual space there.

\documentclass{article}
\usepackage{icomma}

\begin{document}

\( 1,25 \quad 1, 25 \quad (0,7) \quad (0, 7)  \)

\end{document}

enter image description here

antshar
  • 4,238
  • 9
  • 30
  • 2
    Thanks but I wrote I am looking for a not-based-to-any-package workaround. (Moodle environment supports but the basic (La)Tex). – Dimitris May 22 '20 at 12:48