13

What's the problem with a \cmidrule(lr){1}?

Please consider the following MWE

\documentclass{article}

\usepackage{booktabs}

\begin{document}

\begin{table}
\centering
\footnotesize
\begin{tabular}{rcccccc}
\hline
& \multicolumn{3}{c}{Something} & \multicolumn{3}{c}{Something} \\ 
\cmidrule(lr){2-4} \cmidrule(lr){5-7}
Median & 
      1 & 
      1 & 
      0 & 
      1 & 
      2 & 
      3 \\
\cmidrule(lr){1} % <---- Here the issue
SD &
      70.4 & 
      2.5 & 
      1.71 & 
      57.61 & 
      114.53 & 
      308.42 \\
N & 
      15481 & 
      118 & 
      30 & 
      15481 & 
      118 & 
       30 \\
\end{tabular}
\end{table}

\end{document}
20

\cmidrule needs a start and an end column number even if they are the same. That's why you have to use

\cmidrule(lr){1-1}

if only the first column should be underlined.

enter image description here

Code:

\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{table}
\centering
\footnotesize
\begin{tabular}{rcccccc}
\hline
& \multicolumn{3}{c}{Something} & \multicolumn{3}{c}{Something} \\ 
\cmidrule(lr){2-4} \cmidrule(lr){5-7}
Median & 
      1 & 
      1 & 
      0 & 
      1 & 
      2 & 
      3 \\
\midrule(lr){1-1} % <---- changed
SD &
      70.4 & 
      2.5 & 
      1.71 & 
      57.61 & 
      114.53 & 
      308.42 \\
N & 
      15481 & 
      118 & 
      30 & 
      15481 & 
      118 & 
       30 \\
\end{tabular}
\end{table}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.