0

I am using dcolumn for a tabular, and I would like to have a single cell printed in bold face. I know a similar question has been posed here, and here, and the proposed solution is mentioned in the documentation (page 4).

However, the proposed solution does not appear to work, at least in the minimal example below:

\documentclass[aps,prb,reprint]{revtex4-2}
\usepackage{amsmath,amssymb,times,dcolumn}

\newcolumntype{b}{D{.}{.}{3}} \newcolumntype{a}{D{.}{.}{6}}

% Bold version \newcolumntype{B}{>{\boldmath\DC@{.}{.}{3}}c<{\DC@end}} \newcolumntype{A}{>{\boldmath\DC@{.}{.}{6}}c<{\DC@end}}

\begin{document} \begin{table} \begin{tabular}{ab} 1.134(2) & 1.3(1) \ \multicolumn{1}{A}{1.134(2)} & 1.3(1) \end{tabular} \end{table} \end{document}

Compiling with

pdflatex test.tex

gives

! Undefined control sequence.
\@preamble ...hskip 1sp\d@llarbegin \boldmath \DC 
                                                  @{.}{.}{6}\array@row@rst \...
l.15   \multicolumn{1}{A}{1.134(2)}
                                    & 1.3(1)
cesco
  • 165

1 Answers1

2

You get no error if you properly segregate the code using @-commands between \makeatletter and \makeatother, but the final result doesn't seem like you're expecting.

\documentclass[aps,prb,reprint]{revtex4-2}
\usepackage{amsmath,amssymb,times,dcolumn}

\newcolumntype{b}{D{.}{.}{3}} \newcolumntype{a}{D{.}{.}{6}}

% Bold version \makeatletter \newcolumntype{B}{>{\boldmath\DC@{.}{.}{3}}c<{\DC@end}} \newcolumntype{A}{>{\boldmath\DC@{.}{.}{6}}c<{\DC@end}} \makeatother

\begin{document} \begin{table} \begin{tabular}{ab} 1.134(2) & 1.3(1) \ \multicolumn{1}{A}{1.134(2)} & 1.3(1) \end{tabular} \end{table} \end{document}

enter image description here

The main cause for this is times, which has been obsolete for more than a quarter of a century. You get nothing better with mathptmx, which defines no bold math font.

The result is slightly better with NewTX.

\documentclass[aps,prb,reprint]{revtex4-2}
\usepackage{newtxtext,newtxmath}
\usepackage{amsmath,dcolumn}

\newcolumntype{b}{D{.}{.}{3}} \newcolumntype{a}{D{.}{.}{6}}

% Bold version \makeatletter \newcolumntype{B}{>{\boldmath\DC@{.}{.}{3}}c<{\DC@end}} \newcolumntype{A}{>{\boldmath\DC@{.}{.}{6}}c<{\DC@end}} \makeatother

\begin{document} \begin{table} \begin{tabular}{ab} 1.134(2) & 1.3(1) \ \multicolumn{1}{A}{1.134(2)} & 1.3(1) \end{tabular} \end{table} \end{document}

enter image description here

You get the same result using siunitx, that provides many more features.

\documentclass[aps,prb,reprint]{revtex4-2}
\usepackage{newtxtext,newtxmath}
\usepackage{amsmath,siunitx}

\begin{document}

\begin{table}

\begin{tabular}{S[table-format=1.3(1),detect-weight] S[table-format=1.1(1)]} 1.134(2) & 1.3(1) \ \bfseries 1.134(2) & 1.3(1) \end{tabular}

\end{table}

\end{document}

egreg
  • 1,121,712