3

If one uses the @-operator to tweak the space between two columns, \cmidrule needs to be supplied with the width of the trim, otherwise the rule/line looks really awful.

Why is that? I'd rather not, to be honest, as it is quite time-consuming. Also, when specifying the space between two columns, why would the line under the column before be shorter?

(Note: This kind of usage of \cmidrule is taken from here.)

Picture

enter image description here

MWE

\documentclass[
11pt
]{scrartcl}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage{
booktabs,
}

\begin{document}
\begin{center}
\begin{tabular}{lrrrrrr}
\toprule
Words & Series01 & Series02 & Series03 & Series04 & Series05 & Series06\\
\cmidrule(r){1-1}
\cmidrule(lr){2-2}
\cmidrule(lr){3-3}
\cmidrule(lr){4-4}
\cmidrule(lr){5-5}
\cmidrule(lr){6-6}
\cmidrule(l){7-7}
B & 24 & 25 & 15 & 2 & 0 & 9 \\
A & 7 & 21 & 17 & 1 & 0 & 5 \\
B & 24 & 12 & 29 & 26 & 27 & 22 \\
A & 0 & 12 & 14 & 22 & 24 & 2 \\
B & 22 & 8 & 8 & 25 & 24 & 1 \\
A & 29 & 6 & 21 & 14 & 21 & 10 \\
B & 29 & 1 & 13 & 12 & 2 & 11 \\
A & 24 & 18 & 16 & 22 & 19 & 23 \\
B & 18 & 7 & 12 & 1 & 1 & 9 \\
A & 6 & 24 & 10 & 30 & 7 & 15 \\
\bottomrule
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{lrrrr@{\hspace{2pt}}lrr}
\toprule
Words & Series01 & Series02 & Series03 & Series04 & \footnotemark{} & Series05 & Series06\\
\cmidrule(r){1-1}
\cmidrule(lr){2-2}
\cmidrule(lr){3-3}
\cmidrule(lr){4-4}
\cmidrule(lr){5-5}
\cmidrule(lr){6-6}
\cmidrule(lr){7-7}
\cmidrule(l){8-8}
B & 24 & 25 & 15 & 2 & & 0 & 9 \\
A & 7 & 21 & 17 & 1 & & 0 & 5 \\
B & 24 & 12 & 29 & 26 & & 27 & 22 \\
A & 0 & 12 & 14 & 22 & & 24 & 2 \\
B & 22 & 8 & 8 & 25 & & 24 & 1 \\
A & 29 & 6 & 21 & 14 & & 21 & 10 \\
B & 29 & 1 & 13 & 12 & & 2 & 11 \\
A & 24 & 18 & 16 & 22 & & 19 & 23 \\
B & 18 & 7 & 12 & 1 & & 1 & 9 \\
A & 6 & 24 & 10 & 30 & & 7 & 15 \\
\bottomrule& & 
\end{tabular}
\end{center}
\begin{center}
\begin{tabular}{lrrrr@{\hspace{2pt}}lrr}
\toprule
Words & Series01 & Series02 & Series03 & Series04 & \footnotemark{} & Series05 & Series06\\
\cmidrule(r){1-1}
\cmidrule(lr){2-2}
\cmidrule(lr){3-3}
\cmidrule(lr){4-4}
\cmidrule(lr{0.125em}){5-5}
\cmidrule(lr){6-6}
\cmidrule(lr){7-7}
\cmidrule(l){8-8}
B & 24 & 25 & 15 & 2 & & 0 & 9 \\
A & 7 & 21 & 17 & 1 & & 0 & 5 \\
B & 24 & 12 & 29 & 26 & & 27 & 22 \\
A & 0 & 12 & 14 & 22 & & 24 & 2 \\
B & 22 & 8 & 8 & 25 & & 24 & 1 \\
A & 29 & 6 & 21 & 14 & & 21 & 10 \\
B & 29 & 1 & 13 & 12 & & 2 & 11 \\
A & 24 & 18 & 16 & 22 & & 19 & 23 \\
B & 18 & 7 & 12 & 1 & & 1 & 9 \\
A & 6 & 24 & 10 & 30 & & 7 & 15 \\
\bottomrule& & 
\end{tabular}
\end{center}
\end{document}
henry
  • 6,594

1 Answers1

2

The reason for your behaviour is that the trimmed \cmidrule is shortened by a fixed width in regard to the next column. In your MWE, you have minimized the standard distance to the next column and therefore, the trim moves to the left (if you write 20pt, you will see, what I mean).

The most obvious solution here would be to use \midrule instead of all this trimmed rules. Looks much nicer.

Suggesting, that you really need this extra column, I can recommend, not to change the distance between the columns but to move the \footnotemark to the left with some kerning. This will not get recognized by booktabs. If you like, you can give the extra column a fixed width in order to reduce its size a bit.

A last solution would be to leave the blank column away and to set the \footnotemark where it belongs to. The last example would look better with the centred S-column from siunitx.

% arara: pdflatex

\documentclass{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{booktabs}

\begin{document}
    \begin{center}
        \begin{tabular}{lrrrrrr}
            \toprule
            Words & Series01 & Series02 & Series03 & Series04 & Series05 & Series06\\
            \midrule
            B & 24 & 25 & 15 & 2 & 0 & 9 \\
            \bottomrule
        \end{tabular}
    \end{center}
    \begin{center}
        \begin{tabular}{lrrrrlrr}
            \toprule
            Words & Series01 & Series02 & Series03 & Series04 & \kern-2.6ex\footnotemark{} & Series05 & Series06\\
            \cmidrule(r){1-1}
            \cmidrule(lr){2-2}
            \cmidrule(lr){3-3}
            \cmidrule(lr){4-4}
            \cmidrule(l){5-5}
            \cmidrule(lr){7-7}
            \cmidrule(l){8-8}
            B & 24 & 25 & 15 & 2 & & 0 & 9 \\
            \bottomrule
        \end{tabular}
    \end{center}
    \begin{center}
        \begin{tabular}{lrrrrrr}
            \toprule
            Words & Series01 & Series02 & Series03 & Series04\footnotemark{} & Series05 & Series06\\
            \cmidrule(r){1-1}
            \cmidrule(lr){2-2}
            \cmidrule(lr){3-3}
            \cmidrule(lr){4-4}
            \cmidrule(lr){5-5}
            \cmidrule(lr){6-6}
            \cmidrule(l){7-7}
            B & 24 & 25 & 15 & 2 & 0 & 9 \\
            \bottomrule
        \end{tabular}
    \end{center}
\end{document}

enter image description here

Update:

My favorite version (if I'd like the line snippets) would be the following:

\begin{center}
    \begin{tabular}{lrrrrrr}
        \toprule
        Words & Series01 & Series02 & Series03 & Series04\makebox[0pt]{\kern+1ex\footnotemark} & Series05 & Series06\\
        \cmidrule(r){1-1}
        \cmidrule(lr){2-2}
        \cmidrule(lr){3-3}
        \cmidrule(lr){4-4}
        \cmidrule(lr){5-5}
        \cmidrule(lr){6-6}
        \cmidrule(l){7-7}
        B & 24 & 25 & 15 & 2 & 0 & 9 \\
        \bottomrule
    \end{tabular}
\end{center}

The trick is to set the width of your footnotemark to zero which results in equidistant columns. However, you will have to add some kerning to get the right horizontal distance then.

enter image description here

LaRiFaRi
  • 43,807