this is supposed to be an easy question, but I didn't find a clear answer anywhere.
I want to use dcolumn
with comma as a separator. However, I found different solutions and the manual is unclear to me. It says in D{>sep.tex<}{>sep.dvi<}{>decimal places<}
, I have to choose ',' instead of '.' to achieve alignment to the comma. However I dont understand the difference between {>sep.tex<}
and {>sep.dvi<}
.
Also I found a solution where someone only used {>sep.dvi<}
as a comma, whereas the manual suggests to use comma in both, {>sep.tex<}
and {>sep.dvi<}
.
Can someone explain the difference and tell me how to specify it correctly?
MWE simple as that:
\newcolumntype{G}{D..{2.1}}
– where G
currently aligns to the decimal point, not the comma, in case of 2 decimal places before the separator and 1 after.
Thanks.
Best Answer
Remarks
Let's look at the definition
\newcolumntype{>name<}{D{>sep.tex<}{>sep.dvi<}{>decimal places<}}
:>name<
is the name for your new column, limited to one character.>sep.tex<
is the character, which is used for alignment in the TeX code.>sep.dvi<
is the character, which will substitute the>sep.tex<
-character in the output (in most cases identical to>sep.tex<
, because we only use alignment).>decimal places<
is either-1
for auto detect orpre comma places.post comma places
.Example
Output