I am looking for the equivalent of \cline{1-1}
that does not affect the vertical spacing, but with the option to be able to apply a trim such as (lr)
that \cmidrule
allows.
The MWE below produces:
I would like the third table to align vertically with the first two but with the short "\cmidrule(lr){1-1}
" equivalent horizontal line.
Code:
\documentclass[border=5mm]{standalone}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{ l c r }
\toprule
1 & 2 & 3 \\
\hline
4 & 5 & 6 \\
7 & 8 & 9 \\
\bottomrule
\end{tabular}
\begin{tabular}{ l c r }
\toprule
1 & 2 & 3 \\
\cline{1-1}
4 & 5 & 6 \\
7 & 8 & 9 \\
\bottomrule
\end{tabular}
\begin{tabular}{ l c r }
\toprule
1 & 2 & 3 \\
\cmidrule(lr){1-1}
4 & 5 & 6 \\
7 & 8 & 9 \\
\bottomrule
\end{tabular}
\end{document}
Best Answer
Putting David Carlisle's ideas in to practise, by adding two new dimensions
\abovecrulesep
and\belowcrulesep
for\cmidrule
s, givesTo provide a new command whilst keeping the old version of
\cmidrule
one can do the followingThe three
\def
s are copies of the internal\cmidrule
commands that refer to\my...
versions instead. They deal with argument parsing for\cmidrule
and are so short it is easy to copy and modify the code. We then copy the other two internal commands from\cmidrule
with\let
and patch them to use our new commands and parameters. These definitions are longer, so patching is shorter than rewriting.