3

After last update of TeX Live packages this code won't compile:

\documentclass{article}

\usepackage{longtable,tabu}
\usepackage{color}

\begin{document}

\begin{longtabu} to \linewidth {llX}
    a & b & c\\
\end{longtabu}

\end{document}

I got an error:

Missing } inserted. \end{longtabu}

if I comment out \usepackage{color} everything works. Another strange thing - if I change last column type from X to say l - it also works (even with color package added).

5
  • I can reproduce the issue and guess it has to do with recent changes to array.sty, I suspect this is related to tex.stackexchange.com/q/466147/35864
    – moewe
    Jan 7, 2019 at 12:12
  • It seems so. But workaround proposed here (tex.stackexchange.com/a/466261/87293) doesn't work in my situation.
    – andc
    Jan 7, 2019 at 12:16
  • Also, it seems my issue is result of 2019-01-05 la­tex-tools update where issue mentioned by you was fixed.
    – andc
    Jan 7, 2019 at 12:34
  • The source of the problem is a small change in longtable. Jan 7, 2019 at 12:38
  • The fix appears to be incomplete — see github.com/tabu-fixed/tabu/issues/1 — but I’ve just submitted a patch that may help us further along, hopefully not breaking anything in the progress ☺
    – mirabilos
    Feb 24, 2019 at 16:29

2 Answers 2

6

UPDATE 2019-01-14

An equivalent patch has been applied in tabu 2.9 which has been submitted to ctan.


The following seems to work (I also added the other patch):

\documentclass{article}

\usepackage{longtable}
\usepackage{tabu}
\usepackage{color}
\usepackage{etoolbox}

\makeatletter
\patchcmd\tabu@startpboxmeasure
  {\aftergroup\tabu@endpboxmeasure}
  {\aftergroup\tabu@endpboxmeasure
   \color@begingroup
  }{\typeout{tabu patched}}{\typeout{tabu patch failed!}}
  
\patchcmd\tabu@LT@startpbox
 {\bgroup}{\bgroup\color@begingroup}
 {\typeout{tabu patched}}{\typeout{tabu patch failed!}}  
\makeatletter

\begin{document}

\begin{longtabu} to \linewidth {llX}
    a & b & c\\
\end{longtabu}

\end{document}
3
  • Is there a way to run this example with an older version of LaTeX as well (e.g. This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6840 64-bit))? At the moment it crashes with the mentioned version with a "! Extra }, or forgotten \endgroup."
    – albert
    Jan 14, 2019 at 12:26
  • @albert did you ever figure out a way to add this patch only when needed? Mar 29, 2019 at 14:30
  • @AndreasGrapentin No I didn't try as I want to try to stick to official distributions regarding LaTeX. I think this problem should be tackled on github in github.com/tabu-fixed/tabu and afterwards in CTAN distributions.
    – albert
    Mar 29, 2019 at 14:49
2

The new LaTeX3 package tabularray is an alternative to the outdated tabu package:

\documentclass{article}

\usepackage{tabularray}
\usepackage{xcolor}

\begin{document}

\DefTblrTemplate{firsthead}{default}{}

\begin{longtblr}{width=\linewidth,colspec={llX},hlines,row{odd}={blue8},row{even}={azure8}}
 a & b & c \\
 d & e & f \\
 g & h & i \\
 j & k & l \\
\end{longtblr}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .