2

The following MWE illustrates the problem

\documentclass{scrartcl}
\usepackage{booktabs,tabu,blindtext}
\begin{document}
\begin{tabu} spread \linewidth {X}
test\\\midrule
Nunc quis urna dictum turpis accumsan semper.\\\midrule
\blindtext{}\\\midrule
\blindtext{}\newline{}test\\\midrule
asdg\\\midrule
\end{tabu}
\end{document}

The line space is not the same, if there is a linebreak in a row. I would like to have the same line space in the entire table.

enter image description here

Micha
  • 2,869
  • the two lines you've marked aren't the only ones with uneven spacing below them. the spacing is tight below any row that is more than one line long, and even tighter if the last line doesn't have any descenders. (can't offer a fix, but this is a suggestion that whoever does should look at all the "last" lines, not just the two marked lines.) – barbara beeton Jun 05 '14 at 14:25
  • 1
    Adding a \strut to the second line marked line fixes the problem. You should probably add a \strut to the first case as well. I am guessing that the reason it is not absolutely necessary for the first case is that the line does not span the entire width of the text. If you add enough text before it so that it is not just a short line, then you will see the effect. – Peter Grill Jun 05 '14 at 14:34
  • 1
    @PeterGrill, would you like to write an answer? – Paul Gessler Sep 05 '14 at 13:20
  • @PeterGrill Ping? ^^^^ – Johannes_B Oct 04 '15 at 14:14

1 Answers1

2

As per my comments, adding a \strut resolves the issue:

enter image description here

I do not know why it is not needed for the first test line.

Code:

\documentclass{scrartcl}
\usepackage{booktabs,tabu,blindtext}
\begin{document}
\begin{tabu} spread \linewidth {X}
test\strut\\\midrule
Nunc quis urna dictum turpis accumsan semper.\\\midrule
\blindtext{}\\\midrule
\blindtext{}\newline{}test\strut\\\midrule
asdg\\\midrule
\end{tabu}
\end{document}
Peter Grill
  • 223,288
  • This always happens for X cells columns when one cell in a row has more than one line (both explicit and automatic line break). In this case, a manual strut at the end of the longest cell needs to be inserted manually or declared in the column declaration (for every X-column!). See also https://tex.stackexchange.com/questions/21570/strange-line-spacing-effects-in-longtabu – dariok Apr 26 '20 at 16:06