TransWikia.com

RevTeX-4.2 and dcolumn : align decimal with integer numbers

TeX - LaTeX Asked on January 29, 2021

I am creating a table which has to be aligned in the decimal point. I am using the RevTeX-4.2 class and the dcolumn package.

My code is the following

documentclass[reprint,
               superscriptaddress,
               showkeys,
               nofootinbib,
               amsmath,amssymb,
               aps,
               prc,
               floatfix,
               ]{revtex4-2}

usepackage{dcolumn}% Align table columns on decimal point


begin{document}

begin{table}
centering
% table caption is above the table
caption{label{tab:kernels}List of the fission kernels that were able to be extracted with a statistical uncertainty less than $30%$.}
begin{ruledtabular}
%
begin{tabular}{dddd}
%
%header
%
{} & multicolumn{2}{c}{textbf{Fission kernel}} & {}
{} & multicolumn{2}{c}{(meV)}          & {}
multicolumn{1}{c}{$E_n$} & multicolumn{1}{c}{Present work} & multicolumn{1}{c}{Bouland et al.} & multicolumn{1}{c}{Difference}
multicolumn{1}{c}{(eV)} & {} & {} & multicolumn{1}{c}{($%$)}
hline
   1.06footnotemark[1] &   0.00059(3)  &   0.00063 &   -6%STAT
  20.4footnotemark[2]  &   0.027(2)    &   0.019   &   35
  38.4footnotemark[2]  &   0.0078(16)  &   0.0043  &   59
  66.6footnotemark[1]  &   0.021(5)    &   0.016   &   25%STAT
  72.8footnotemark[1]  &   0.044(8)    &   0.041   &    8%STAT
 152.0footnotemark[1]  &   0.099(6)    &   0.094   &    6%STAT
 260.5footnotemark[1]  &   0.048(14)   &   0.038   &   26%STAT
 287.0footnotemark[1]  &   0.30(9)     &   0.30    &   -2%STAT
 405.0footnotemark[1]  &   0.33(8)     &   0.36    &   -8%STAT
 743.1footnotemark[2]  &   0.017(3)    &   0.040   &   -82
 750.1footnotemark[2]  &   8.0(9)      &   6.9     &   16
 778.1footnotemark[1]  &   0.020(4)    &   0.019   &    3%STAT
 783.1footnotemark[1]  &   3.8(6)      &   3.8     &    1%STAT
 790.5footnotemark[1]  &   5.5(8)      &   5.7     &   -3%STAT
1402footnotemark[1]    &   10.3(20)    &   9.6     &    7%STAT
1842footnotemark[1]    &   8.2(8)      &   7.7     &    6%STAT
1902footnotemark[1]    &   3.2(6)      &   2.8     &   12%STAT
1917footnotemark[1]    &   20(3)       &   21      &   -4%STAT
1948footnotemark[1]    &   7.5(14)     &   6.0     &   22%STAT
1955footnotemark[1]    &   18(3)       &   20      &   -13%STAT
2033footnotemark[2]    &   10.3(25)    &   6.6     &   43
2698footnotemark[1],footnotemark[3]   &   82(10)      &   77      &    6%STAT - ENERGY
6551footnotemark[1]    &  12.5(2.2)   &   -       &    -
7508footnotemark[1]    &   64(19)     &   -       &    -
8098 footnotemark[1]   &  111(27)     &   -       &    -
end{tabular}
%
%
end{ruledtabular}
footnotetext[1]{Agreement within statistical uncertainties}
footnotetext[2]{Discrepancy beyond statistical uncertainties}
footnotetext[3]{Resonance energy was found higher by $4$ eV}
end{table}

end{document}

and the output can be seen below

enter image description here

I guess the issue here is that I am trying to align decimal numbers with integer ones. The dcolumn package should take car of non-decimal number, according to its documentation so I don’t understand the issue… Could be the parentheses, but I need them, so a workaround this would be great!

One Answer

I introduced a new column with digit alignment and introduced rlap tag for footnote numbers, here is the modified tags:

documentclass[reprint,
               superscriptaddress,
               showkeys,
               nofootinbib,
               amsmath,amssymb,
               aps,
               prc,
               floatfix,
               ]{revtex4}

usepackage{dcolumn}% Align table columns on decimal point
newcolumntype{z}[1]{D{.}{.}{#1}}%

begin{document}

begin{table}
centering
% table caption is above the table
caption{label{tab:kernels}List of the fission kernels that were able to be extracted with a statistical uncertainty less than $30%$.}
begin{ruledtabular}
%
begin{tabular}{z{4,2}z{2,5}z{2,5}z{2}}
%
%header
%
{} & multicolumn{2}{c}{textbf{Fission kernel}} & {}
{} & multicolumn{2}{c}{(meV)}          & {}
multicolumn{1}{c}{$E_n$} & multicolumn{1}{c}{Present work} & multicolumn{1}{c}{Bouland et al.} & multicolumn{1}{c}{Difference}
multicolumn{1}{c}{(eV)} & {} & {} & multicolumn{1}{c}{($%$)}
hline
   1.06rlap{footnotemark[1]} &   0.00059(3)  &   0.00063 &   -6%STAT
  20.4rlap{footnotemark[2]}  &   0.027(2)    &   0.019   &   35
  38.4rlap{footnotemark[2]}  &   0.0078(16)  &   0.0043  &   59
  66.6rlap{footnotemark[1]}  &   0.021(5)    &   0.016   &   25%STAT
  72.8rlap{footnotemark[1]}  &   0.044(8)    &   0.041   &    8%STAT
 152.0rlap{footnotemark[1]}  &   0.099(6)    &   0.094   &    6%STAT
 260.5rlap{footnotemark[1]}  &   0.048(14)   &   0.038   &   26%STAT
 287.0rlap{footnotemark[1]}  &   0.30(9)     &   0.30    &   -2%STAT
 405.0rlap{footnotemark[1]}  &   0.33(8)     &   0.36    &   -8%STAT
 743.1rlap{footnotemark[2]}  &   0.017(3)    &   0.040   &   -82
 750.1rlap{footnotemark[2]}  &   8.0(9)      &   6.9     &   16
 778.1rlap{footnotemark[1]}  &   0.020(4)    &   0.019   &    3%STAT
 783.1rlap{footnotemark[1]}  &   3.8(6)      &   3.8     &    1%STAT
 790.5rlap{footnotemark[1]}  &   5.5(8)      &   5.7     &   -3%STAT
1402rlap{footnotemark[1]}    &   10.3(20)    &   9.6     &    7%STAT
1842rlap{footnotemark[1]}    &   8.2(8)      &   7.7     &    6%STAT
1902rlap{footnotemark[1]}    &   3.2(6)      &   2.8     &   12%STAT
1917rlap{footnotemark[1]}    &   20(3)       &   21      &   -4%STAT
1948rlap{footnotemark[1]}    &   7.5(14)     &   6.0     &   22%STAT
1955rlap{footnotemark[1]}    &   18(3)       &   20      &   -13%STAT
2033rlap{footnotemark[2]}    &   10.3(25)    &   6.6     &   43
2698rlap{footnotemark[1]},rlap{footnotemark[3]}   &   82(10)      &   77      &    6%STAT - ENERGY
6551rlap{footnotemark[1]}    &  12.5(2.2)   &   -       &    -
7508rlap{footnotemark[1]}    &   64(19)     &   -       &    -
8098 rlap{footnotemark[1]}   &  111(27)     &   -       &    -
end{tabular}
%
%
end{ruledtabular}
footnotetext[1]{Agreement within statistical uncertainties}
footnotetext[2]{Discrepancy beyond statistical uncertainties}
footnotetext[3]{Resonance energy was found higher by $4$ eV}
end{table}

end{document}

Note that I don't have have the class file what you used, so I used revtex4 instead of yours.

Answered by MadyYuvi on January 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP