reutenauer / polyglossia

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

luabidi undefined control sequence on MacOS MikTeX #652

Closed shevvek closed 1 month ago

shevvek commented 1 month ago

Loading Hebrew crashes in a fresh install of MiKTeX on MacOS.

\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{hebrew}
\newfontfamily{\hebrewfont}{Shofar}[Script=Hebrew]

\begin{document}
  .
\end{document}
Package: luabidi 2023/10/01 v0.6 Bidirectional typesetting in LuaTeX

! Undefined control sequence.
l.83 \matheqdirmode
                 =1

Opening the issue here since the github page for luabidi appears to be more or less abandoned. (?)

Udi-Fogiel commented 1 month ago

Which version of LuaTeX do you have installed?

shevvek commented 1 month ago

Log output begins:

This is LuaHBTeX, Version 1.14.0 (MiKTeX 22.1) (format=lualatex 2024.7.12)  13 JUL 2024 13:04
 restricted system commands enabled.
Udi-Fogiel commented 1 month ago

You have a version from two years ago, \matheqdirmode was introduced in LuaTeX 1.15 (current version is 1.18). I don't mind adding a test for that in luabidi, but regardless I recommend to install newer versions.

For the time being, you can add the line \newcount\matheqdirmode before loading the hebrew gloss file.

shevvek commented 1 month ago

Wow, surprised that could occur with a fresh install. Okay, thanks!

Udi-Fogiel commented 1 month ago

I'm not sure what you mean by fresh install... MikTeX 22.1 was released in January 2022, the current version is 24.4 (released in April 2024). Having older LuaTeX binaries from an old distribution is not really surprising. From where did you install MikTeX?

shevvek commented 1 month ago

That's apparently still the most recent version offered for Mac. https://miktex.org/download

I guess this is why people don't use MiKTeX except on Windows.

Udi-Fogiel commented 1 month ago

Oh, I see... Well then we should probably add a test in luabidi.

jspitz commented 1 month ago

@Udi-Fogiel do you want to do that before we release?

Udi-Fogiel commented 1 month ago

@jspitz I think the test should be added to luabidi, something like

\ifdefined\matheqdirmode
    \matheqdirmode=1
\fi
jspitz commented 1 month ago

Please go ahead. I'll wait with the release for this.

jspitz commented 1 month ago

Ah, sorry, luabidi issue. Got it.

jspitz commented 1 month ago

I wonder, however, how such a fix could help. I can release a new version of luabidi, of course, but that won't travel back in time to make it into MikTeX 22.1.

I'd rather close this as non-fixable. The workaround for those with the old version is documented here.

Udi-Fogiel commented 1 month ago

I'm really not sure what MikTeX 22.1 has or not. People can always install latest version of packages themselves, and his log does specify format=lualatex 2024.7.12, so it looks like the formats are up to date, but the binaries are not.

Personally I don't like to support old binaries with new formats, it feels like a mess, but some packages (like siunitx) have extensive testing for dependencies and options to rollback, it is a matter of taste I guess, so up to you...

Note that babel use that without a test https://github.com/latex3/babel/blob/dcd551427599879303b7a047b6fd3aef0a77120e/babel.dtx#L15691-L15693 but opTeX does test for that: https://github.com/olsak/OpTeX/blob/4a7fe5d2afb77ad47b994cdeb19b81c3992cabd6/optex/base/parameters.opm#L67-L70 Ultimately there is an easy workaround for users.

jspitz commented 1 month ago

We always rely on current environment. Also polyglossia is not backwards compatible to older versions of TeXLive.

jspitz commented 1 month ago

Closing