Skip to main content
@Mico we clashed edits
Source Link
David Carlisle
  • 828.7k
  • 74
  • 1.7k
  • 2.6k

Update This answer addresses a workaround for revtex4-1 which is not needed with current releases (revtex4-2)


booktabs sets the default widths in a font dependent way (em units) but it seems that revtex does not set up the font until \begin{document} so you need to delay setting the rule widths via the \AtBeginDocument directive shown below.

\documentclass{revtex4} \usepackage{array,mathtools,amssymb,booktabs} \newcolumntype{C}{>{$}c<{$}} \AtBeginDocument{% \heavyrulewidth=.08em \lightrulewidth=.05em \cmidrulewidth=.03em \belowrulesep=.65ex \belowbottomsep=0pt \aboverulesep=.4ex \abovetopsep=0pt \cmidrulesep=\doublerulesep \cmidrulekern=.5em \defaultaddspace=.5em } \begin{document} \begin{tabular}{cCCC} \toprule \multicolumn{2}{c}{} & K & H\\\midrule A & a & 1& 4\\\cmidrule(lr){2-4} B & b & 2 & 5\\\cmidrule(lr){1-4} \multicolumn{2}{c}{C}& 3 & 6\\\bottomrule \end{tabular} \end{document} 

booktabs sets the default widths in a font dependent way (em units) but it seems that revtex does not set up the font until \begin{document} so you need to delay setting the rule widths via the \AtBeginDocument directive shown below.

\documentclass{revtex4} \usepackage{array,mathtools,amssymb,booktabs} \newcolumntype{C}{>{$}c<{$}} \AtBeginDocument{% \heavyrulewidth=.08em \lightrulewidth=.05em \cmidrulewidth=.03em \belowrulesep=.65ex \belowbottomsep=0pt \aboverulesep=.4ex \abovetopsep=0pt \cmidrulesep=\doublerulesep \cmidrulekern=.5em \defaultaddspace=.5em } \begin{document} \begin{tabular}{cCCC} \toprule \multicolumn{2}{c}{} & K & H\\\midrule A & a & 1& 4\\\cmidrule(lr){2-4} B & b & 2 & 5\\\cmidrule(lr){1-4} \multicolumn{2}{c}{C}& 3 & 6\\\bottomrule \end{tabular} \end{document} 

Update This answer addresses a workaround for revtex4-1 which is not needed with current releases (revtex4-2)


booktabs sets the default widths in a font dependent way (em units) but it seems that revtex does not set up the font until \begin{document} so you need to delay setting the rule widths via the \AtBeginDocument directive shown below.

\documentclass{revtex4} \usepackage{array,mathtools,amssymb,booktabs} \newcolumntype{C}{>{$}c<{$}} \AtBeginDocument{% \heavyrulewidth=.08em \lightrulewidth=.05em \cmidrulewidth=.03em \belowrulesep=.65ex \belowbottomsep=0pt \aboverulesep=.4ex \abovetopsep=0pt \cmidrulesep=\doublerulesep \cmidrulekern=.5em \defaultaddspace=.5em } \begin{document} \begin{tabular}{cCCC} \toprule \multicolumn{2}{c}{} & K & H\\\midrule A & a & 1& 4\\\cmidrule(lr){2-4} B & b & 2 & 5\\\cmidrule(lr){1-4} \multicolumn{2}{c}{C}& 3 & 6\\\bottomrule \end{tabular} \end{document} 
added 74 characters in body
Source Link
Mico
  • 552.6k
  • 57
  • 753
  • 1.3k

booktabs sets the default widths in a font dependent way (em units) but it seems that revtex does not set up the font until \begin{document} so you need to delay setting the rule widths: via the \AtBeginDocument directive shown below.

\documentclass{revtex4} \usepackage{array,mathtools,amssymb,booktabs} \newcolumntype{C}{>{$}c<{$}}   \AtBeginDocument{%  \heavyrulewidth=.08em  \lightrulewidth=.05em  \cmidrulewidth=.03em  \belowrulesep=.65ex  \belowbottomsep=0pt  \aboverulesep=.4ex  \abovetopsep=0pt  \cmidrulesep=\doublerulesep  \cmidrulekern=.5em  \defaultaddspace=.5em }   \begin{document} \begin{tabular}{cCCC} \toprule \multicolumn{2}{c}{} & K & H\\\midrule A & a & 1& 4\\\cmidrule(lr){2-4} B & b & 2 & 5\\\cmidrule(lr){1-4} \multicolumn{2}{c}{C}& 3 & 6\\\bottomrule \end{tabular} \end{document} 

booktabs sets the default widths in a font dependent way (em units) but it seems that revtex does not set up the font until \begin{document} so you need to delay setting the rule widths:

\documentclass{revtex4} \usepackage{array,mathtools,amssymb,booktabs} \newcolumntype{C}{>{$}c<{$}} \AtBeginDocument{ \heavyrulewidth=.08em \lightrulewidth=.05em \cmidrulewidth=.03em \belowrulesep=.65ex \belowbottomsep=0pt \aboverulesep=.4ex \abovetopsep=0pt \cmidrulesep=\doublerulesep \cmidrulekern=.5em \defaultaddspace=.5em } \begin{document} \begin{tabular}{cCCC} \toprule \multicolumn{2}{c}{} & K & H\\\midrule A & a & 1& 4\\\cmidrule(lr){2-4} B & b & 2 & 5\\\cmidrule(lr){1-4} \multicolumn{2}{c}{C}& 3 & 6\\\bottomrule \end{tabular} \end{document} 

booktabs sets the default widths in a font dependent way (em units) but it seems that revtex does not set up the font until \begin{document} so you need to delay setting the rule widths via the \AtBeginDocument directive shown below.

\documentclass{revtex4} \usepackage{array,mathtools,amssymb,booktabs} \newcolumntype{C}{>{$}c<{$}}   \AtBeginDocument{%  \heavyrulewidth=.08em  \lightrulewidth=.05em  \cmidrulewidth=.03em  \belowrulesep=.65ex  \belowbottomsep=0pt  \aboverulesep=.4ex  \abovetopsep=0pt  \cmidrulesep=\doublerulesep  \cmidrulekern=.5em  \defaultaddspace=.5em }   \begin{document} \begin{tabular}{cCCC} \toprule \multicolumn{2}{c}{} & K & H\\\midrule A & a & 1& 4\\\cmidrule(lr){2-4} B & b & 2 & 5\\\cmidrule(lr){1-4} \multicolumn{2}{c}{C}& 3 & 6\\\bottomrule \end{tabular} \end{document} 
Source Link
David Carlisle
  • 828.7k
  • 74
  • 1.7k
  • 2.6k

booktabs sets the default widths in a font dependent way (em units) but it seems that revtex does not set up the font until \begin{document} so you need to delay setting the rule widths:

\documentclass{revtex4} \usepackage{array,mathtools,amssymb,booktabs} \newcolumntype{C}{>{$}c<{$}} \AtBeginDocument{ \heavyrulewidth=.08em \lightrulewidth=.05em \cmidrulewidth=.03em \belowrulesep=.65ex \belowbottomsep=0pt \aboverulesep=.4ex \abovetopsep=0pt \cmidrulesep=\doublerulesep \cmidrulekern=.5em \defaultaddspace=.5em } \begin{document} \begin{tabular}{cCCC} \toprule \multicolumn{2}{c}{} & K & H\\\midrule A & a & 1& 4\\\cmidrule(lr){2-4} B & b & 2 & 5\\\cmidrule(lr){1-4} \multicolumn{2}{c}{C}& 3 & 6\\\bottomrule \end{tabular} \end{document}