5

There is a conflict between the four packages tikz, tabularx, array and arydshln. The MWE below compiles, if I do not

  • load tikz ( tikz.sty 2015/08/07 v3.0.1a (rcs-revision 1.151))
  • (load todonotes (todonotes.sty 2018/11/22) calls tikz)
  • use tabularx (usepackage and environment, tabularx.sty 2016/02/03 v2.11b)
  • load array (array.sty 2018/11/13 v2.4j)
  • load arydshln (arydshln.sty 2018/09/26 v1.74)

As @daleif noted, tikz called by todonotes is part of the problem.

Using all, I get:

! Extra }, or forgotten \endgroup. \@endpbox ...th \dp \@arstrutbox \fi \par \egroup \adl@colhtdp \box \adl@box... l.22 \end{tabularx}

\documentclass{article}

\usepackage{tikz}
% \usepackage{todonotes}
\usepackage{tabularx}
\usepackage{array}
\usepackage{arydshln}

\begin{document}
    \begin{tabular}{l l l }
        A & B & C
  \end{tabular}

  \begin{tabularx}{\textwidth}{l X X}
        A & B & C
  \end{tabularx}

\end{document}

How can I use all four packages without conflict?

ebcontrol
  • 564
  • it is not todonotes as is, you get the same error if you replace it with tikz (todonotes is build on tikz). – daleif Dec 13 '18 at 12:08

1 Answers1

3

This is due to an internal change in array we may try to adjust so the error goes away but in the mean time if you change the package order it works again

\documentclass{article}

\usepackage{arydshln}
\usepackage{todonotes}
\usepackage{tabularx}
\usepackage{array}


\begin{document}
    \begin{tabular}{l l l }
        A & B & C
  \end{tabular}

  \begin{tabularx}{\textwidth}{l X X}
        A & B & C
  \end{tabularx}

\end{document}
David Carlisle
  • 757,742
  • This works for my MWE, but not if I change the tabular argument to {l : l l } – ebcontrol Dec 13 '18 at 12:54
  • @ebcontrol, oops I'll raise this with the team... (I'll post a temporary workaround here in a bit) – David Carlisle Dec 13 '18 at 13:08
  • A Japanese LaTeX user also reported a similar issue: https://oku.edu.mie-u.ac.jp/tex/mod/forum/discuss.php?d=2550 - here I answered a workaround to revert array.sty's \@startpbox (removing \color@begingroup). Should i contact the author of arydshln (Mr. Nakashima), or expect the LaTeX team will resolve it? – Hironobu YAMASHITA Dec 18 '18 at 03:58
  • Of course this issue can be minimalized to \usepackage{color} + \usepackage{array} + \usepackage{arydshln}. (Note: arydshln-man.pdf says arydshln should be loaded after array.) – Hironobu YAMASHITA Dec 18 '18 at 09:07
  • @davidcarlisle It seems that arydshln.sty modifies \@endpbox based on previous version of array.sty, but it does not modify \@startpbox. For this reason, the update of array.sty made two macros incosistent. – Hironobu YAMASHITA Dec 18 '18 at 09:12
  • @Hironobu YAMASHITA, this resolved my issues! Using: \usepackage{arydshln} \usepackage{array} \makeatletter \usepackage{etoolbox} \patchcmd{@startpbox}{\color@begingroup}{}{}{} \makeatother I can compile both the MWE and my not so minimal document – ebcontrol Dec 18 '18 at 13:18
  • @HironobuYAMASHITA please could you contact the author, as Frank notes here https://tex.stackexchange.com/a/466261/1090 the extra colour group was added to array to fix a definite colour-leak bug in that code so unfortunately that requires some updates in higher level packages if they assume a specific group structure. – David Carlisle Dec 18 '18 at 13:33
  • @DavidCarlisle OK, I'll contact the author Nakashima-san. – Hironobu YAMASHITA Dec 18 '18 at 22:46
  • @HironobuYAMASHITA thanks, sorry we should have caught this earlier and given advance warning, but it's hard to check every package for every change... – David Carlisle Dec 18 '18 at 23:22
  • @DavidCarlisle I sent an e-mail to Nakashima-san. (Cc'ed to public list on Japanese Community: https://ml.texjp.org/pipermail/issue/2018-December/000203.html ) – Hironobu YAMASHITA Dec 19 '18 at 03:53
  • Nakashima-san sent me a candidate of new arydshln.sty and works fine ;-) – Hironobu YAMASHITA Dec 26 '18 at 11:11
  • The fixed version of arydshln.sty v1.75 is out; available from CTAN. – Hironobu YAMASHITA Dec 28 '18 at 03:47
  • @HironobuYAMASHITA Could you inform the author that there is a similar problem with longtable (the newest version from the tools update a few days ago)? A simple example is here https://chat.stackexchange.com/transcript/message/48413939#48413939. It breaks with ! Extra }, or forgotten \endgroup.. – Ulrike Fischer Jan 08 '19 at 20:09
  • @UlrikeFischer Already done yesterday; https://ml.texjp.org/pipermail/issue/2019-January/000208.html and the author replied that he will look into it ;-) – Hironobu YAMASHITA Jan 09 '19 at 21:46
  • @HironobuYAMASHITA thank you (I found today the message, and even if I can't read it I could see that it is about the problem.) – Ulrike Fischer Jan 09 '19 at 21:49
  • @HironobuYAMASHITA I apologise we didn't get more advance notice of this to package authors, just unfortunate timing that the original bug report on array came close to the latex release, it was a clear bug (color leaked from a table cell, and easy to fix by adding "color groups") but we should perhaps have deferred it to give more time to contact package authors. – David Carlisle Jan 09 '19 at 21:58
  • @DavidCarlisle arydshln v1.76 arrived on CTAN and TL: https://tug.org/svn/texlive?view=revision&revision=50084 it seems that the author fixed the conflict with longtable. – Hironobu YAMASHITA Feb 23 '19 at 01:13