-
-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct handling of lost chars in boxes with LuaTeX #1691
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is unfortunately not enough for the issue at hand. LaTeX sets \tracinglostchars in several places, i.e., in \tracingall and \tracingnone and those need to be adjusted as well.
By the way what are the differences between the different values 2/3/4 ?
OK, so perhaps plan B is \ifdefined\directlua
\chardef\tracinglostchars@on=4
\else
\chardef\tracinglostchars@on=3
\fi then use this in the definition of |
For 4/5 instead of 2/3 - 'Hans agreed to match the classical behaviour when prodded' |
Plan B would presumably go in |
we could do, or alternatively as
shouldn't it be 3+2=5 ? |
or more exactly shouldn't the tracing values be 2 and 4, was it intended to make |
so
|
I guess it was the intention back then, even though ltnews is a bit vague on the subject. However I'm okay with lkeeping it always just a warning which would also resolve the still open issue that
Or alternatively, we go
I think I'm in favor of the latter solution so that in LaTeX \tracinglostchars has the usual meaning for 0,1,2,3 for all engines. |
@FrankMittelbach yes it ocurred to me that that would mean we could/should remove it from \tracingall/tracingnone. I'm not sure I like the macro setter, it would work well for setting but I think you'd need to support |
true, that is a catch and not worth trying to find a solution for (even though there probably is one given that it is only needed in LuaTeX). But if not we need an ltnews entry that explain that you need to do =5 not =3 with LaTeX to get missing glyph errors. |
No, it's not that - you'll get errors if you set to 3, but only when the text is used. The new higher values are needed to get a missing char error when characters are typeset in a box, before the box is used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would also need ltnews entry telling people to use 4 in luatex
base/ltplain.dtx
Outdated
% \begin{macrocode} | ||
%<latexrelease>\IncludeInRelease{2021/06/01}{\loggingall} | ||
%<latexrelease> {\tracingstacklevels and \tracinglostchars=3}% | ||
%<*2ekernel|latexrelease> | ||
\edef\loggingall{% | ||
\tracingstats\tw@ | ||
\tracingpages\@ne | ||
\tracinglostchars\thr@@ | ||
\tracinglostchars |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed in the comments, 3/5 is consistent with the change making it 3 back in 2021 but I think that was in error and over-compensenation for the fact that we increased the default from 1 to 2 at that time.
I don't think it's expected that \tracingall
makes non-error conditions into errors, so I would make this 2 and 4 or (more simply) remove the setting from here and from \tracingnone
so the generic tracing on/off commands leave this at its default level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to set to 2 all of the time, does it even need to be in \tracingall
, etc.? The standard setting is now 2 anyway. (Or are we worrying about places that set to zero/one not being reset?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree \tracingall should not make it an error (it should simply leave the setting alone) but the recommendation for users in ltnews is to set it to 3 (to always make it an error) and that sensible and thus the new recommendation for LuaTeX would need to be to set it to 5 not 4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@josephwright "does it even need to bein tracingall
" No it doesn't, that's what @FrankMittelbach and I suggested: "or (more simply) remove the setting from here "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, so I remove the setting entirely from \tracingall
and \loggingall
, so we just have the initial setup plus the adjustment to \showhyphens
, and I add something to ltnews41
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Do we need rollback for that? I'm guessing no)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't need rollback but the whole setting of \tracinglostchars shoulw be removed including the next 9 lines setting it to 3 or 5. And the same with \tracingnone. It should stay transparent to whatever LaTeX has set or the user has changed to.
If there is a setting it should first save the current value (to return to that in \tracingnone) and then set it to 2/4 but I think it is over-engineering and we should take out the set as suggested by @davidcarlisle
Again, only if they want identical behaviour to pdfTeX, etc.: setting to 2 or 3 still works, it's only an issue for boxes ... |
but that is my point; yes you still get errors with a setting of 3 but not necessarily always (in contrast to pdftex, say) so to get the same behavior as with the other engines you need to set it to 5 not 3 in luatex |
Yes, true - I guess I wonder if that's our job to document, as this is not something we control, it's an engine feature. |
3 only works if you use the box (and I think this is where this came up) it doesn't error at all if you don't use it, so
won't error if the font has no |
I believe that LuaTeX has always been wrong in the treatment of Likely Or, in the long run, we could ask the maintainers of pdftex to make 4 act the same as 2 and 5 the same as 3. |
base/ltplain.dtx
Outdated
\tracinglostchars | ||
\ifdefined\luatexversion | ||
\ifnum\luatexversion>120 % | ||
4 % | ||
\else | ||
\tw@ | ||
\fi | ||
\else | ||
\tw@ | ||
\fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
take out ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on it :)
d677ecb
to
82056f5
Compare
but our recommendation is/was that people should set it so that they get an error if their document lost glyphs because the warnings are easily overlooked. And such an error is also important if there is some box setting going on even if the box is not use but only its features, e.g. its width or height. So yes, I think we should recomment that they set it to 5 with LuaTeX as painful as that may be. |
26e8601
to
a5a0303
Compare
base/doc/ltnews41.tex
Outdated
\subsection{Tracing lost characters} | ||
|
||
The \eTeX{} primitive \cs{tracinglostchars} allows the user to obtain a warning | ||
or error if a character is not available. The default value used in \LaTeX{} is | ||
set so that lost character information is written to the log and terminal. | ||
Users may wish to make this into an error, in which case they should set it to | ||
one higher. This is a \TeX{} primitive so the syntax for this is: | ||
\begin{verbatim} \advance\tracinglostchars by 1\relax \end{verbatim} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to also mention that \tracingall
no longer sets \tracinglostchars=3
?
When \tracinglostchars=3
was added to \tracingall
, an entry was added to ltnews33, LaTeX release 2021-06-01.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One for @FrankMittelbach to decide about :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than advance, couldn't we just tell to use 5 which gives an error on all engines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a correction to a previous statement I think it is worth pointing out, eg something like
In LaTeX news 33~\cite{41:ltnews33} we announced that \cs{tracingall} changes \cs{tracinglostchars} to an error condition. This change has been reverted and \cs{tracingall} and \cs{tracingnone} no longer alter \cs{tracinglostchars} but retain its current setting.
or something along these lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than advance, couldn't we just tell to use 5 which gives an error on all engines
I agree that make the reading an explanation simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than advance, couldn't we just tell to use 5 which gives an error on all engines
OK, although I'm a bit wary that formally the behaviour is formally undefined for engines other than LuaTeX here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general all the tracing parameters are defined for all integer values, with all values larger acting like the largest defined value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TeXbook 212 but its only explicitly says so for \tracingcommands there. Anyway, I think David is right high values give you the largest defined one by convention in all engines
{\tracingassigns} | ||
{into \tracingassigns=1} | ||
{the letter h} | ||
Missing character: There is no h ("68) in font nullfont! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting XeTeX behaves differently than pdfTeX when \tracinglostchars=2
, but the same with pdfTeX when \tracinglostchars=3
.
% \tracinglostchars=2
% pdftex
Missing character: There is no h in font nullfont!
% xetex
Missing character: There is no h ("68) in font nullfont!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, doubt it's deliberate - but I'm not sure there is much to be done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it isn't perfect but it isn't that much of a problem either (for us 1-2 extra tlg files due to the differences)
Co-authored-by: Yukai Chou <[email protected]>
READ ME FIRST: Please understand that in most cases we will not be able to merge a pull request because there are a lot of internal activities needed when updating the LaTeX2e sources. If you have a code suggestion please discuss it with the team first.
Internal housekeeping
Status of pull request
Checklist of required changes before merge will be approved
\changes
entries in source includedchanges.txt
updatedltnewsX.tex
(and/orlatexchanges.tex
) updated