1

I have a document with two longtabu tables. The problem is that there's too much vertical space between them (as marked by the red line):

Problematic space between tables

I'd like to reduce this space whilst otherwise preserving the layout. Here's the code:

\documentclass{scrartcl}
\usepackage{longtable}
\usepackage{tabu}
\usepackage{xcolor}
\usepackage{blindtext}
\newlength{\firstcolumn}
\setlength{\firstcolumn}{3.5cm}
\renewcommand*{\familydefault}{\sfdefault}
\begin{document}
\tabulinesep=1.5mm
\begin{longtabu} to
  \textwidth{@{}p{\firstcolumn}X}%
  \textcolor{gray}{\rule{\firstcolumn}{0.15cm}} &
  \textcolor{gray}{\Large\mdseries\upshape Test} \\
  A - B & My first line  \\
  & My second line \\
  D - F & \blindtext \\
\end{longtabu}
\begin{longtabu} to \textwidth{@{}p{\firstcolumn}X}%
  \textcolor{gray}{\rule{\firstcolumn}{0.15cm}} &
  \textcolor{gray}{\Large\mdseries\upshape Test 2} \\
  A - B & My first line  \\
  & My second line \\
  & My third line  \\
  & \blindtext \\ 
\end{longtabu}
\end{document}
1

If this is rare cases in your document, the simplest way is put \vskip-1em between tables. This will reduce vertical space for 1em:

  ...
  D - F & \blindtext \\
\end{longtabu}\vskip-1em
\begin{longtabu} to \textwidth{@{}p{\firstcolumn}X}%
  \textcolor{gray}{\rule{\firstcolumn}{0.15cm}} &
  ...
1

the \tabulinesep is used after the last row, too. Use \vspace*:

\documentclass{scrartcl}
\usepackage{longtable}
\usepackage{tabu}
\usepackage{xcolor}
\usepackage{blindtext}
\newlength{\firstcolumn}
\setlength{\firstcolumn}{3.5cm}
\renewcommand*{\familydefault}{\sfdefault}
\raggedbottom
\begin{document}
 \extrarowsep=1.5mm 
    \begin{longtabu} to 
        \textwidth{@{}p{\firstcolumn}X}%
        \textcolor{gray}{\rule{\firstcolumn}{0.15cm}} &
        \textcolor{gray}{\Large\mdseries\upshape Test} \\
        A - B & My first line  \\
        & My second line \\
        D - F & \blindtext 
    \end{longtabu}

\vspace*{\dimexpr-\extrarowdepth-\extrarowheight}
    \begin{longtabu} to \textwidth{@{}p{\firstcolumn}X}%
        \textcolor{gray}{\rule{\firstcolumn}{0.15cm}} &
        \textcolor{gray}{\Large\mdseries\upshape Test 2} \\
        A - B & My first line  \\
        & My second line \\
        & My third line  \\
        & \blindtext 
    \end{longtabu}

\end{document}

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.