1

I have a strange behaviour regarding longtable and array packages: When including the array package, I can no longer change the row spacing using \\[...] syntax. MWE:

\documentclass[a4paper,11pt]{scrartcl}
\usepackage{longtable}
% \usepackage{array} % Uncomment to trigger problem
\usepackage{lipsum}
\begin{document}
\begin{longtable}{ p{3cm} | %>{\raggedright\let\newline\\\arraybackslash}
p{10cm} }
a & b\\
c & \lipsum[1] \\[4cm]
d & e
\end{longtable}
\end{document}

(Remark: I want the right column to be left aligned instead of block text. Thus I wanted to use the array package.) Somehow it seems that LaTeX interprets the 4cm in the MWE differently if array is included or not:

  • Without array there is 4cm spacing between row 2 and 3. This is my intention.
  • With array included it seems that the 4cm are interpreted as something like the minimal height of a row. Enlarge it sufficiently and change the amount of text. In my compiled PDFs the third row is always on the same position or pushed down if the text is too much.

Can you confirm this behaviour? What can I do to avoid this?

  • I cannot recreate the problem. Perhaps your package versions are out of date/sync. Packages: scrkbase 2017/04/13 v3.23 scrbase 2017/04/13 v3.23 keyval 2014/10/28 v1.15 scrlfile 2017/04/13 v3.23 tocbasic 2017/04/13 v3.23 typearea 2017/04/13 v3.23 longtable 2014/10/28 v4.11 array 2016/10/06 v2.4d lipsum 2014/07/27 v1.3 – Steven B. Segletes Jun 25 '18 at 11:54
  • This could be a bug. I'm using Arch Linux and this behaviour occurs with texlive-core-2018.47471-1 (current package) and does not occur with texlive-core-2017.46770-1. I already found another space-related bug with the current package and don't know yet how to track it... – nox Jun 25 '18 at 12:03
  • These are my versions: scrartcl.cls 2018/03/30 v3.25 scrkbase.sty 2018/03/30 v3.25 scrbase.sty 2018/03/30 v3.25 keyval.sty 2014/10/28 v1.15 scrlfile.sty 2018/03/30 v3.25 tocbasic.sty 2018/03/30 v3.25 scrsize11pt.clo 2018/03/30 v3.25 typearea.sty 2018/03/30 v3.25 longtable.sty 2014/10/28 v4.11 array.sty 2018/04/30 v2.4h lipsum.sty 2014/07/27 v1.3 I cannot switch back to 2017 easily. But I just synced from TeXLive everything. This did nothing to improve the problem. – Christian Wolf Jun 25 '18 at 12:30
2

Even without array it doesn't work as you expect. The space depends on in which column the long text is:

\documentclass[a4paper,11pt]{scrartcl}
\usepackage{longtable}
% \usepackage{array} % Uncomment to trigger problem
\usepackage{lipsum}
\begin{document}
\begin{longtable}{ p{10cm} | p{10cm} }
c &\lipsum[1] \\[4cm]
xxxxxxxxxx & xxxxxxxxxxx\\
\lipsum[1] &  c\\[4cm]
xxxxxxxxxx & xxxxxxxxxxx
\end{longtable}
\end{document}

enter image description here

With the newest version of array both case will give the same result and lead to a "minimum height".

If you really want a space imho the easiest is to insert an additional line:

  c &\lipsum[1] \\ \\[4cm]

An alternative is an invisible rule at the end of the long text.

  • This is at least a workaround. It is not nice as it adds the space of one additional line. As I want to use it in a macro definition I need to make the extra line only if the additional spacing is requested by the caller of the macro. – Christian Wolf Jun 25 '18 at 12:34
  • 1
    Hiding this in a macro is not difficult. The handling at page breaks is more a problem. – Ulrike Fischer Jun 25 '18 at 12:37
  • This it absolutely right and I did not even think of it yet. – Christian Wolf Jun 25 '18 at 12:46

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.