latex3 / latex2e

The LaTeX2e kernel
https://www.latex-project.org/
LaTeX Project Public License v1.3c
1.82k stars 251 forks source link

LaTeX release of 2024-06-01 (or rather perhaps the array package update) appears to have broken tabulary #1368

Closed jfbu closed 1 month ago

jfbu commented 1 month ago

Brief outline of the bug

./testtabulary.tex:10: Missing \cr inserted.
<inserted text> 
                \cr 
l.10 \end{tabulary}

I'm guessing that you meant to end an alignment here.

I noticed the latexbug message but from a user point of view the idea is that my report will reach the maintainers of the relevant packages as they are to the best of my knowledge all members of the LaTeX team, and it is hard for me to decide whether to report to tabulary or to array or to kernel because for that I would have to spend the time identifying the root cause. Thanks for your understanding.

Minimal example showing the bug

\documentclass{article}

\RequirePackage{latexbug}
\usepackage{tabulary}

\begin{document}

\begin{tabulary}{1cm}{L}
hello
\end{tabulary}
\end{document}

Log file (required) and possibly PDF file

testtabulary.log

u-fischer commented 1 month ago

Yes, the error is known. There is already a version with a fix in the tabulary repo https://github.com/davidcarlisle/dpctex and it will be uploaded to ctan soon.

jfbu commented 1 month ago

@u-fischer good that it is already fixed, I had very hastily checked https://github.com/davidcarlisle/dpctex and did not see there a ticket matching my issue... (doesn't seem to be https://github.com/davidcarlisle/dpctex/issues/47

davidcarlisle commented 1 month ago

@jfbu no the issue was reported by email so there isn't a github issue. Perhaps I should make one but I'm hoping to release a new version today anyway (still got a few things to test) and I may decide to try to fix https://github.com/davidcarlisle/dpctex/issues?q=is%3Aissue+is%3Aopen+tabulary at same time, plus add a rollback, so it may not get done today.

davidcarlisle commented 1 month ago

Closing this here as it's being handled at https://github.com/davidcarlisle/dpctex

FrankMittelbach commented 4 weeks ago

@jfbu would it be possible for you to test your installations with the -dev release prior to the nominal date? This way such incompatibilities would be caught in time if we miss them because it is very hard for us to test all combinations even if something like tabulary is by an author of the LaTeX team? Would really help I think.

jfbu commented 4 weeks ago

@FrankMittelbach I usually do have such a set-up. I am aware of -dev. I do not alway work on same computers. I am not involved with LaTeX all year long. I may remain for months without doing any LaTeX. I became engaged in a project at end of May and was not paying attention to upcoming LaTeX release. The nature of the project already obliged me to complete my LaTeX installation as I do not have for reasons of disk space full TL. So in the end indeed that project does provide a test bed with about 800 documents but almost all of them are with packages not maintained by LaTeX team. If i had set-up my Makefile to use latex-dev this would have indeed helped find out about these problems. I will probably push a commit so that their project uses latex-dev. I can't do a similar thing in the Sphinx project I am involved with. People may have installations which are so old that latex-dev does not exist. We even test whether xcolor is there or not.

FrankMittelbach commented 4 weeks ago

I was not trying to critizise. It is just that the more the -dev formats are used in test suites the better, so whenever it is possible it is good to do so and helps ... sometimes it isn't.

logological commented 4 weeks ago

A similar problem seems to have affected nicematrix when used in combination with bidi. When I compile

\RequirePackage{latexbug}
\documentclass{article}

\usepackage{nicematrix}
\usepackage{bidi}

\begin{document}
\begin{NiceTabular}{lllll}
a & b & c & d & e \\
\end{NiceTabular}
\end{document}

I get the error message

! Extra alignment tab has been changed to \cr.
<template> \endtemplate 

l.10 \end{NiceTabular}

foo.log

Is the cause the same as for the problem reported here for tabulary? (I already e-mailed the nicematrix maintainer about this, but thought I would ask here in case it's known that a similar fix needs to be applied to their package.)

u-fischer commented 4 weeks ago

@logological imho the problem lies in the redefinitions of bidi, it overwrites most of the array definitions. You could try something like this, but it is quite possible that more corrections are needed.

\documentclass{article}

\usepackage{nicematrix}
\usepackage{bidi}
\makeatletter
\def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}}
\makeatother%

\begin{document}
\begin{NiceTabular}{lllll}
a & b & c & d & e \\
\end{NiceTabular}
\end{document}
logological commented 4 weeks ago

I've since discovered that use of bidi now interferes with other tabular-like environments, including longtable. I can try reporting all this to the bidi maintainer.

logological commented 3 weeks ago

@u-fischer Thanks; that seems to work for me. Any chance you could suggest a similar workaround for kvafa/bidi#41? It looks like the bidi maintainer hasn't been active for about ten months, so I am not hopeful that they will release a fix soon.

u-fischer commented 3 weeks ago

@logological no work-around needed. The hotfix we sent to ctan yesterday and will in texlive hopefully tomorrow should repair this.

logological commented 2 weeks ago

@u-fischer: Thanks; I can confirm that kvafa/bidi#41 and kvafa/bidi#42 are no longer reproducible with array 2.6d of 2024-06-14.

logological commented 2 weeks ago

@u-fischer: I have discovered further breakage with bidi, this time affecting polyglossia: kvafa/bidi#43 Is this yet again a consequence of the recent changes to array? If so, could you provide a workaround? (And should I be reporting these problems as new issues here, or continuing to piggyback them onto this issue? Do we need a dedicated tracking bug for array-related breakage?)

u-fischer commented 2 weeks ago

@logological You are jumping to conclusions here. Only because the previous issues were related to array and a recent LaTeX change doesn't mean that every issue is an "array breakage". For a problem with hyphenation it is actually quite improbable as no tabular is involved. You can easily check that the issue is not new: Get yourself an overleaf account and compile with e.g. texlive 2022 and you will see that nothing changed here; it is a clearly bidi problem, which inserts a \beginL at the begin and so suppress hyphenation. And no, you should not continue to use this issue to get general bidi support. If you are unsure where to report a problem or are looking for a work around, ask on a general support site like e.g. tex.stackexchange.

logological commented 2 weeks ago

@u-fischer You're right, of course -- I noticed three issues in rapid succession and wrongly assumed that the third was related to the first two. I'll test more thoroughly in the future.