3

My MWE,

\documentclass[a4paper,11pt]{book}
\usepackage{empheq}
\begin{document}
0,5
\begin{empheq}{align}
0,5
\end{empheq}
\end{document}

Good (normal) is comma in first 0,5 .

enter image description here

But not good in {empheq} package 0,5 . It have a little space. I want to delete space.

enter image description here

I didn't find duplicate another question. So, does anyone know how to fix it?

Related to: Space after comma in units package

3
  • 1
    Use 0{,}5..... – user11232 Nov 28 '14 at 0:07
  • A workaround is 0{,}5. The comma always inserts a small space because of the other uses, like (a,b), or \{0,1,2,3\}. In any case, I would choose to write 0.5 and then change the output later. Here is an option. – Manuel Nov 28 '14 at 0:07
  • 1
    This has nothing to do with empheq; in math mode, the comma is classified as punctuation, so TeX automatically adds a thin space after it. – egreg Nov 28 '14 at 0:09
2

This has nothing to do specifically with empheq. The simple document

\documentclass{article}
\begin{document}
0,5 $0,5$
\end{document}

will show the same behavior. In math mode a comma is a punctuation symbol, so TeX automatically adds a thin space after it, which is needed in formulas like $(a,b)$.

Either you use 0{,}5 in math mode, because this makes the comma into an ordinary symbol or use a dedicated package such as siunitx.

\documentclass{article}
\usepackage{siunitx}

\sisetup{output-decimal-marker={,}}

\begin{document}
\num{0,5} or \num{0.5} % text mode

$\num{0,5}$ or $\num{0.5}$ % math mode
\end{document}

enter image description here

As you can see, the output is independent of whether you use a period or a comma in the input.

2

You can reduce the space by putting comma inside braces like 0{,}5. But it is better to use siunitx.

\documentclass[a4paper,11pt]{book}
\usepackage{empheq}
\usepackage[detect-all]{siunitx}
\begin{document}
0,5
\begin{empheq}{align}
0{,}5\\
\num[output-decimal-marker = {,}]{0.5}
\end{empheq}
\end{document}

enter image description here

1
  • Harish Kumar, I wrote about 60 pages. Approximately 600 commas. Is it macro possible, commas only in empheq equation. x,y --> x{,}y Because I don't working your with siunitx package. – Özgür Nov 28 '14 at 2:15

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.