2

I am working with the REVTeX4.1 class and I want to have some numbers aligned to their decimal point on tables. Following the REVTeX 4 Author’s Guide p13, I am using the dcolumn package. However, when I include it, the vertical spacing in the tables decreases, too much in my opinion. I would like to know if there is a procedure to both align to decimal places, and to keep the vertical spacing on tables.

Here is the code before adding the dcolumn package, with nice vertical spacing but no decimal point alignment.

\documentclass[aps,pra,reprint]{revtex4-1}
\begin{document}

\begin{table}
\begin{ruledtabular}
\begin{tabular}{ccc}
Property & Value & Unit\\
\colrule
$\epsilon_{\text{w}}$ & $7.2\times 10^{-5}$ & g cm/V$^2$s$^2$ \\ 
$\eta$  & $1.33\times10^{-2}$ & g/cm s\\
\end{tabular}
\end{ruledtabular}
\end{table}

\end{document}

enter image description here

Here is after adding the dcolumn spacing, where the table seems to loose the vertical spaces between its rows, but the numbers are aligned to the decimal point.

\documentclass[aps,pra,reprint]{revtex4-1}

\usepackage{dcolumn}

\begin{document}

\begin{table}
\begin{ruledtabular}
 \begin{tabular}{cdc}
  Property & \text{Value} & Unit\\
  \colrule
  $\epsilon_{\text{w}}$ & 7.2\times 10^{-5} & g cm/V$^2$s$^2$ \\ 
  $\eta$ & 1.33\times10^{-2} & g/cm s\\
 \end{tabular}
 \end{ruledtabular}
\end{table}

\end{document}

enter image description here

3
  • Welcome to TeX.SX! Have you tried siunitx?
    – TeXnician
    Commented May 12, 2017 at 5:23
  • @TeXnician S columns from siunitx don't play well with ruledtabular, unfortunately.
    – campa
    Commented May 12, 2017 at 5:48
  • @TeXnician yes I have also tried with siunitx, but I get the same result as when I use dcolumn Commented May 12, 2017 at 8:49

2 Answers 2

1

The ruledtabular environment, in addition to inserting double horizontal rules, modifies quite a few table-related parameters, see @Mico answer and @DavidCarlisle answer. You can use solutions from these answers, or design own solution, for example based on use of the Xhline which are defined in the makecell package and use of S column defined in the siunitx package, which also enable consistent writing of units:

% considered
%   https://tex.stackexchange.com/questions/267868/
%       does-ruledtabular-environment-from-revtex4-1-break-the-s-column-in-siunitx
\documentclass[aps,pra,reprint]{revtex4-1}
\usepackage{siunitx}
\usepackage{makecell}

\usepackage{lipsum}

\begin{document}
\lipsum[1]
\begin{table}[ht]
\sisetup{per-mode=symbol,
         bracket-unit-denominator=false,
         table-align-exponent=false,
         table-format=1.2e+1,
         table-align-text-post=false}
\renewcommand\arraystretch{1.3}
\begin{tabular*}{0.9\linewidth}{@{\extracolsep{\fill}} c S l}
    \Xhline{0.8pt}
Property                & {Value}   & Unit \\
    \Xhline{0.4pt}
$\epsilon_\mathrm{w}$   & 7.2e-5    & \si{\gram\centi\meter\per\squared\volt\per\squared\second}    \\
$\eta$                  & 1.33e-2   & \si{\gram\per\centi\meter\per\second}                         \\
    \Xhline{0.8pt}
 \end{tabular*}
\end{table}
\lipsum[2-4]
\end{document}

which gives:

enter image description here

0

I found an answer here that works properly. The bad thing is that an extra rule needs to be added by hand on each line of every table. It seems to me that the package array (which is both included by dcloumn and siunitx) manages to change the spacing parameters of the tables on a revtex document in a poor way.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .