Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question

1 Answer 1

up vote 5 down vote accepted

\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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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