latex3 / babel

The babel system for LaTeX, LuaLaTeX and XeLaTeX
LaTeX Project Public License v1.3c
124 stars 34 forks source link

Missing \protected@file@percent #224

Closed Rimole closed 1 year ago

Rimole commented 1 year ago

babel has

\def\babel@aux#1#2{% \select@language{#1}% \bbl@foreach\BabelContentsFiles{% \relax -> don't assume vertical mode \@writefile{##1}{\babel@toc{#1}{#2}\relax}}}% TODO - plain?

(that should be \@ no space writefile, but github automatically changes it to @WriteFile) which should be

\def\babel@aux#1#2{% \select@language{#1}% \bbl@foreach\BabelContentsFiles{% \relax -> don't assume vertical mode \@writefile{##1}{\babel@toc{#1}{#2}\relax\protected@file@percent}}}% TODO - plain?

(that should be \@ no space writefile, but github automatically changes it to @WriteFile) because it is writing to the table of contents (see "\protected@file@percent" in source2e.pdf). Thank you!

jbezos commented 1 year ago

Please, post a MWE showing an actual issue. In principle, a % after \relax is unnecessary, because with the latter spaces and eols are gobbled. On the other hand, perhaps it would be sensible to replace \relax by \protected@file@percent.

FrankMittelbach commented 1 year ago

If I remember correctly I used \protected@file@percent back then for two reasons:

u-fischer commented 1 year ago

@FrankMittelbach yes, we added a real % to avoid troubles with look aheads, see egreg comment here: https://github.com/latex3/latex2e/issues/73

jbezos commented 1 year ago

In this case the lookahead is not relevant, because \babel@toc is a babel internal macro, which relies on the \relax trick. I’ve doubts there is an actual issue, but who knows.

jbezos commented 1 year ago

I’m closing this issue because it isn’t an actual issue.