# Vertical spacing after a tabu environment

When creating a tabu with two rows, I get more vertical spacing after the environment than when I create a tabu with only one row.

In the document below, the first tabu has two lines, and there is a small space between the end of the table and the rule below it. In the second tabu, I only have one line, and there is a larger space below it.

\documentclass{article}
\usepackage{geometry}
\usepackage{tabu}

\geometry{a4paper}

\begin{document}
\begin{tabu} to \textwidth {X X}%
These are words & in the first line \\%
These are more words & in the second line%
\end{tabu}\par%
\rule{\textwidth}{0.4pt}\par%
%
%
\vspace{2em}\par%
%
%
\begin{tabu} to \textwidth {X X}%
These are words & in the first line%
\end{tabu}\par%
\rule{\textwidth}{0.4pt}\par%
%
\end{document}


I've been quite careful (I think) with whitespace around the tabu, and I see no difference in the two tables aside from the different number of lines.

I know that I could fix this by adding a \vspace{0.5em} or similar right after the tabu with the small spacing, but I am using the tables in a custom command and I would like to avoid a hard-coded solution like this if possible.

This problem also comes up if I substitute a tabular for the tabu. Adding \tabulinesep=Xem fixes (or appears to fix) the problem for large X (>1em), but I need small spacings (ideally, ~0em).

Any ideas?

• Read the readme here: github.com/tabu-issues-for-future-maintainer/tabu. Nov 21 '19 at 19:24
• The same issue is found with the tabular package; it is not unique to tabu Nov 21 '19 at 19:27
• then better make a tabular example. I never try to debug tabu. Nov 21 '19 at 19:45
• Do you recommend an edit or a new question? Nov 21 '19 at 19:59

Too big for a comment ...

Discovered phenomena is not related only to tabu, but it can be observable at all table environments. For example, at tabularx too:

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage{tabularx}
\setlength\parindent{0pt}

\begin{document}
\begin{tabularx}{\textwidth}{X X}%
\hline
These are words & in the first line \\%
These are more words & in the second line\\
\hline%
\end{tabularx}\par%
\rule{\textwidth}{0.4pt}\par%

%
\vspace{2em}
%
\begin{tabularx}{\textwidth}{X X}%
\hline
These are words & in the first line\\
\hline%
\end{tabularx}\par%
\rule{\textwidth}{0.4pt}\par%
%
\end{document}


which gives:

This is caused by some strange interaction between tables and \rule. If you replace \rule with text:

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage{tabularx}
\setlength\parindent{0pt}

\usepackage{lipsum}

\begin{document}
\begin{tabularx}{\textwidth}{X X}%
\hline
These are words & in the first line \\%
These are more words & in the second line\\
\hline%
\end{tabularx}\par%
\lipsum[66]

\vspace{2em}
%
\begin{tabularx}{\textwidth}{X X}%
\hline
These are words & in the first line\\
\hline%
\end{tabularx}\par%
\lipsum[66]
\end{document}


than result is as expected:

• it is not strange. It is simply due to the fact that the second tabular has a rather large depth. Nov 21 '19 at 20:32