12

I got some strange effect with longtabu:
enter image description here
As you can see the line with λ seems to be closer to the above line than to the one below of it. I cant’t figure out why …

This is the code with which I produced the above picture:

\documentclass[
    fontsize=11pt,
]{scrbook}

\usepackage{xltxtra}

\usepackage{array}
\usepackage{tabu}
\usepackage{longtable}

\usepackage[osf]{libertine}

\begin{document}
    \begin{longtabu} to \textwidth {lX}
         \textbf{L} & Musica incantans sive poema exprimens musicae vires per illam juvene in insaniam
        acto et musici inde periculum. Authore Roberto South Art. Bac. ex Aede Christi. Oxonii, Typis
        Leon. Lichfield Academiae Typographi, Impensis Tho. Robinson. Anno 1655. \\ 
         \textbf{λ} & \textit{Überarbeitete, zweite Fassung des Gedichts zwischen 1655 und 1667.} \\ 
         \textbf{W} & Musica incantans sive poema exprimens musicae vires juvenem in insaniam adigentis et
        musici inde periculum. Authore Roberto South Art. Bac. ex Aede Christi. Oxonii, Typis W.\,H.,
        Impensis G. West. Anno Dom. 1667. \\ 
    \end{longtabu}%
\end{document}

The workaround is to put an invisible rule to the λ line to make it higher.

lockstep
  • 250,273
Tobi
  • 56,353

3 Answers3

19

It seems that tabu forgets to put a \strut at the end of an X cell, so

\begin{longtabu} to \textwidth {lX<{\strut}}

should solve the problem.

egreg
  • 1,121,712
  • Thank you! I tried to put a \strut manually before the λ. But that didn’t work. Do you know why? [Shall I send this as a bug report to the tabu developer?] – Tobi Jun 25 '11 at 10:33
  • 4
    I've sent a message to comp.text.tex to signal the problem; tabu's author is very active there. – egreg Jun 25 '11 at 10:47
  • 3
    Ah, and the problem with the strut before the λ is that it adjusts the row's height, but what's wrong is the depth of the previous row. – egreg Jun 25 '11 at 11:00
  • The key is that the one line X column correctly sets the following row. – egreg Jun 25 '11 at 22:02
  • This problem still exists. It affects all cells in an X column that have more than one line (both by manual and automatic line breaks). One-liners are not affected. And – just to add because I grew a grey hair or two over this before noticing – every X column that may have more than 1 line needs the explicit \strut in the declaration. – dariok Apr 26 '20 at 16:09
  • @dariok I don't know what to say: the workaround, as you seem to be telling, works. – egreg Apr 26 '20 at 16:16
  • @egreg Yes, the workaround does indeed work. Yet this is a 9 year old problem that’s still confusing people from time to time and forgetting to add the strut to all X columns might be a common cause for irritation. Hence, I thought a comment that reflects this state and contains a reminder for potential problems might just be helpful for other users hitting this thread. – dariok Apr 27 '20 at 00:54
  • @dariok The answer is: don’t use tabu. It’s buggy and unmaintained. – egreg Apr 27 '20 at 07:31
3

Another solution is to to put

\tabulinesep=1.2mm

before the longtabu-environment.

\documentclass[
    fontsize=11pt,
]{scrbook}

\usepackage{xltxtra}

\usepackage{array, tabu, longtable}

\usepackage[osf]{libertine}

\begin{document}
\tabulinesep=1.3mm
    \begin{longtabu} to \textwidth {lX}
         \textbf{L} & Musica incantans sive poema exprimens musicae vires per illam juvene in insaniam
        acto et musici inde periculum. Authore Roberto South Art. Bac. ex Aede Christi. Oxonii, Typis
        Leon. Lichfield Academiae Typographi, Impensis Tho. Robinson. Anno 1655. \\ 
         \textbf{λ} & \textit{Überarbeitete, zweite Fassung des Gedichts zwischen 1655 und 1667.} \\ 
         \textbf{W} & Musica incantans sive poema exprimens musicae vires juvenem in insaniam adigentis et
        musici inde periculum. Authore Roberto South Art. Bac. ex Aede Christi. Oxonii, Typis W.\,H.,
        Impensis G. West. Anno Dom. 1667. \\ 
    \end{longtabu}

\end{document}
Sveinung
  • 20,355
1

The new LaTeX3 package tabularray is an alternative to the outdated tabu package. You may try the longtblr environment:

\documentclass[fontsize=11pt,]{scrbook}

\usepackage{xltxtra} \usepackage[osf]{libertine}

\usepackage{tabularray} \SetTblrInner[longtblr]{rowsep=0pt}

\begin{document}

\begin{longtblr}[ caption = {Long Caption}, ]{colspec={lX},width=\linewidth,column{1}={font=\bfseries}} L & Musica incantans sive poema exprimens musicae vires per illam juvene in insaniam acto et musici inde periculum. Authore Roberto South Art. Bac. ex Aede Christi. Oxonii, Typis Leon. Lichfield Academiae Typographi, Impensis Tho. Robinson. Anno 1655. \ λ & \textit{Überarbeitete, zweite Fassung des Gedichts zwischen 1655 und 1667.} \ W & Musica incantans sive poema exprimens musicae vires juvenem in insaniam adigentis et musici inde periculum. Authore Roberto South Art. Bac. ex Aede Christi. Oxonii, Typis W.,H., Impensis G. West. Anno Dom. 1667. \ \end{longtblr}

\end{document}

enter image description here

L.J.R.
  • 10,932