#601 \cmidrule and align columns

open
nobody
None
1
2013-11-19
2013-11-18
Anonymous
No

Please treat cmidrule like cline (but not 100% identical since cmidrule has different arguments). Currently the alignment is broken and causes the first column to be as wide as all the cmidrule statements.

Sample tex-code
\begin{tabular}{ll}
\multicolumn{2}{c}{Header} \
1 & 2 \ \cline
(r){1-2}
1 & 2
\end{tabular}

ps please allow anonymous bug reports. Now I have to file it as a feature request.

Discussion

  • what do you mean by "the aligment is broken"

    what do you expect/what you see with txs ?

     
  • Tim Hoffmann
    Tim Hoffmann
    2013-11-19

    Got the test code from the original poster:

    % Here is a table with cmidrule:
    \begin{tabular}{llll}
        1 & 2 & 3 & 4 \\ \cmidrule(lr){1-2} \cmidrule(lr){3-4}
    1 & 2 & 3 &             4
    \end{tabular}
    
    % What happens when aligning this table:
    \begin{tabular}{llll}
        1                                       & 2 & 3 & 4 \\
        \cmidrule(lr){1-2} \cmidrule(lr){3-4}
    1 & 2 & 3 & 4
    \end{tabular}
    
    % What happens when aligning a table with cline:
    \begin{tabular}{llll}
        1 & 2 & 3 & 4 \\ \cline{1-2}
        1 & 2 & 3 & 4
    \end{tabular}
    
    % What should happen when aligning a table with cmidrule:
    \begin{tabular}{llll}
        1 & 2 & 3 & 4 \\ \cmidrule(lr){1-2} \cmidrule(lr){3-4}
        1 & 2 & 3 & 4
    \end{tabular}
    

    Answer:
    For standard tex commands you could simple add the command to Options -> Advanced Editor -> Table Autoformatting -> Special Commands. However this doesn't work for \cmidrule since it has a very unconventional ()-bracket parameter. We would have to see if that can be made to work with our internal TeX parser. Therefore I cannot promise if an when this could be solved.