4

In my document, I try to remove most of the vertical stretch, using some of the tricks detailed in this document. Specifically, I have

\setlength{\lineskiplimit}{-10pt}
\setlength{\lineskip}{0pt}

This, however, does not play nicely with \cmidrule from booktabs. From other posts, I gleaned, that the tabular environment uses different spacing methods, i.e., it sets \baselineskip to zero and relies on the \lineskiplimit to get correct spacing. This breaks when using the trick above, which is made even more clear when using \setlength{\lineskiplimit}{-999pt}: any table is rendered as a single line, in which all content is overlapping. What is a good/elegant way to fix this problem?

edit: The package grid is often mentioned as solving (part of) the grid typesetting issue, but this package also breaks \tabular:

\documentclass{article}
\usepackage{grid}
\begin{document}
\begin{tabular}{cc}
    one & two \\
    three & four \\end{tabular}
\end{document}
  • 3
    If TeX is inserting \lineskip you have already been pushed off the grid as the line did not fit within \baselineskip, so it isn't clear that disabling this helps in general. If you do disable it then as you say, you need to put it back for tables, and math alignments and several other things. – David Carlisle Oct 7 '13 at 10:15
2

Using David's suggestion, I used

\let\oldtabular\tabular
\let\oldendtabular\endtabular
\def\tabular{\setlength{\lineskiplimit}{0pt}\oldtabular}
\def\endtabular{\oldendtabular\setlength{\lineskiplimit}{-10pt}}

which more or less seems to fix the problem. If anyone has a more elegant/better solution, please let me know!

  • Hi Michel -- Have you tried using \\ [3pt] at the end of the first row without incorporating David's suggestion. I did that with your code and I got a non-overlapping text as the David's suggestion would do. – Jesse Oct 7 '13 at 14:49
  • Jesse, that would mean changing all occurrences of \\ to \[3pt], in the whole document. I'd rather have it work automatically :) – Michel Oct 9 '13 at 15:35

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.