Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question already has an answer here:

I'm writing a report in a language that uses decimal commas. In some cases that clashes with commas used for punctuation, causing hard to read text, e.g.:

for $x_i \in [-1,5, 1,5]$.

Is there a way to make this more readable?

share|improve this question
2  
    
Of course you aren't writing \[ and \] for the brackets, are you? –  egreg Jul 26 '11 at 17:54
    
@egreg: Oops, no I'm not. –  htorque Jul 26 '11 at 17:58
add comment

marked as duplicate by krlmlr, dustin, mafp, Martin Schröder, Xavier Jul 28 '13 at 0:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4 Answers

up vote 22 down vote accepted

If you're using the comma as decimal separator, then you should consider using the semi-colon for the interval separator, it will be more readable:

interval example

$x_i\in[-1{,}5;1{,}5]$

(Instead of typing 1{,}5, you can also use the icomma package as suggested by egreg or \num as suggested by Werner.)

share|improve this answer
    
That was the first version I tried. Looks good on the screen but I didn't like it very much when printed. –  htorque Jul 26 '11 at 18:12
    
+1, semicolon should absolutely be used. Spacing is nice and all but even with proper spacing this is way too confusing otherwise. –  Konrad Rudolph Jul 26 '11 at 18:52
2  
@htorque: in French you would also add a thin space \, before the semi-colon. To my eye, it improves even further the readability of the formula, but depending on the language you're using, it might be against the rules. –  Philippe Goutet Jul 26 '11 at 19:04
    
+1 also from me. A semicolon should be used indeed. –  Stephen Dec 25 '12 at 15:59
add comment
\usepackage{icomma}
...
for $x_{i}\in[-1,5, 1,5]$.

Notice the space after the comma where you want it to act as a punctuation symbol.

share|improve this answer
    
Nice, definitely an improvement! Yet I think it still needs additional space between the elements (like suggested by Stephen). –  htorque Jul 26 '11 at 18:11
add comment

You could try \; or \, or ~ as space (instead of " "):

$x_i \in [-1,5,\;1\,1~1,5]$

and use a semicolon for the interval separator (as already suggested by Philippe Goutet).

share|improve this answer
add comment

The siunitx package provides a general way of treating numbers and their decimal symbols. However, you have to explicitly encompass the numbers with \num{...}. For example:

\documentclass{article}
\usepackage[decimalsymbol=comma]{siunitx}
\begin{document}
This is a range $x_i \in [\num{-1,5},\num{1,5}]$.
\end{document}​​​​​​​​​​​​​​​​​​

would produce

Comma as decimal symbol

share|improve this answer
    
This has been replaced by output-decimal-marker in siunitx version 2. –  krlmlr Jul 27 '13 at 20:31
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.