reutenauer / polyglossia

An alternative to Babel for XeLaTeX and LuaLaTeX
http://www.ctan.org/pkg/polyglossia
MIT License
190 stars 51 forks source link

Fix writing order to the aux and toc file when exiting RTL language #586

Closed Udi-Fogiel closed 1 year ago

Udi-Fogiel commented 1 year ago

A fix to https://github.com/reutenauer/polyglossia/issues/585

jspitz commented 1 year ago

Thank you so much, @Udi-Fogiel! I am closing this as the real problem seems to be elsewhere.

Udi-Fogiel commented 1 year ago

@jspitz It looks like the order of \selectlanguage * that appears in the .toc file is reversed when exiting RTL languages. For example, when exiting hebrew back to english I get

\selectlanguage *{english}
\selectlanguage *[variant=us,ordinalmonthday=false]{english}

while if I exit from french back to english I get

\selectlanguage *[variant=us,ordinalmonthday=false]{english}
\selectlanguage *{english}

Is it important? if so, a similar patch to this one should fix it. Just out of curiosity, when there are invocations of the form

\selectlanguage *[variant=us,ordinalmonthday=false]{english}
\selectlanguage *{english}

what is the current language features? does \selectlanguage {english} overwrite \selectlanguage [variant=us,ordinalmonthday=false]{english}?

jspitz commented 1 year ago
\selectlanguage *[variant=us,ordinalmonthday=false]{english}
\selectlanguage *{english}

what is the current language features? does \selectlanguage {english} overwrite \selectlanguage [variant=us,ordinalmonthday=false]{english}?

No, as the second call has no options, it basically does nothing.