Closed ethey closed 3 years ago
I don't get any underfull box with babel from your example, but I get a third equation number because of the \\
after the last split. When I add \listfiles
to the preamble it reports
*File List*
article.cls 2020/04/10 v1.4m Standard LaTeX document class
size10.clo 2020/04/10 v1.4m Standard LaTeX file (size option)
babel.sty 2021/05/16 3.59 The Babel package
nil.ldf 2021/05/16 3.59 Nil language
amsmath.sty 2020/09/23 v2.17i AMS math features
amstext.sty 2000/06/29 v2.01 AMS text
amsgen.sty 1999/11/30 v2.0 generic functions
amsbsy.sty 1999/11/29 v1.2d Bold Symbols
amsopn.sty 2016/03/08 v2.02 operator names
l3backend-pdftex.def 2021-05-07 L3 backend support: PDF output (pdfTeX)
***********
as version numbers.
@FrankMittelbach you used pdftex, but the report says the problem is with lualatex (and I get underfull hboxes there).
@u-fischer ok one should read to the end, sorry. So yes, it is there in LuaTeX and to report it report here seems correct, as it comes from
\bbl@mathboxdir ->\ifcase \bbl@thetextdir \relax \everyhbox {\textdir TLT\relax
}\else \everyhbox {\textdir TRT\relax }\fi
Thus \begindir TLT
ends up in each and every hbox and that is basically deadly ... in particular here
\split@ ->\hbox to\wd \thr@@ {}&\vcenter {\vbox {\moveleft \wd \thr@@ \boxz@ }}
Tex doesn't report underful boxes when they are empty (so the above was fine but with the TLT node added it isn't any longer empty, thus ... :-)
At least that is how I read it.
Well, one could argue that such nodes just setting direction should not change the state of the box being empty or not, but I'm not sure that is going to be a sell for the LaTeX developers --- but maybe it is.
Alternatively, to stay with changing stuff that's under our control, change \bbl@mathboxdir
to
\def\bbl@mathboxdir{\ifcase \bbl@thetextdir \relax
\everyhbox {\bbl@mathboxdir@ L}\else\everyhbox{\bbl@mathboxdir@ R}\fi}
\def\bbl@mathboxdir@#1{\@ifnextchar\egroup{}{\textdir T#1T\relax}}
(Not tested but the idea is to suppress the \textdir TLT
when the box is empty.)
cool approach @blefloch , can't think of a reason why that shouldn't work.
I have tested on my document, and none of the spurious bad boxes are reported anymore.
Also, I almost did not want to report this because I could not figure out where this came from. Basically what you did @FrankMittelbach was to use \showoutput
and noticed the \begindir TLT
?
Yes (after reading your report when Ulrike pointed out my initial mistake). From there it was a little guesswork, but likely that @jbezos introduced it so I'll cut down your example further and then did a \traceon
on it searching for suspicious usages of TLT :-) the rest was easy.
Thanks!
You have sent 8 replies before I even read it! 🙂 Seems easy to fix (actually, there is very likely another issue, because this function should not be enabled by default, only with bidi =
).
@blefloch Nice. It fails if there is some macro (eg, \@empty
), but it's a very good solution.
When using a split environment inside an align one, I always get an Underfull \hbox warning if Babel is loaded.
Here is a minimal working example:
If I remove Babel, then I do not have any warning. Visually I do not observe any difference in the PDF that is produced, and this only seems to happen with LuaLaTeX, and not pdfLaTeX nor XeLaTeX. So I am not sure if that should be reported here.
I have tried with an up to date version of TeXLive 2021.