0

I'm trying to build the tests subdirectory of the polyglossia package sources. While building, I get the error:

! Undefined control sequence.
<recently read> \ifluatex

l.5 \ifluatex \RequirePackage{luabidi}\else\RequirePackage{bidi}\fi

I know a similar question has been asked regarding MikTeX:

Undefined control sequence \ifluatex when using document class comjnl.cls

but - the solutions there don't seem to be valid in my case. I have both the luatex and the iftex packages installed on my system. What am I missing?

einpoklum
  • 12,311
  • 3
    iftex.sty being installed on the system will not help unless the code does \RequirePackage{iftex} and uses it. – David Carlisle Jun 24 '22 at 08:28
  • @DavidCarlisle: I was assuming the package authors had taken care of that; perhaps they haven't. I'll ask there and report back here. Thanks. – einpoklum Jun 24 '22 at 08:33
  • 2
    You can easily check in the log file that has that message if iftex.sty has been loaded. You did not show the log here so we can't really say anything – David Carlisle Jun 24 '22 at 08:40

2 Answers2

1

As @DavidCarlisle suggests, it is necessary to

\RequirePackage{iftex}

before the use of \ifluatex.

But that's not all. Or rather, you need to make sure that this change is made to the .sty file that actually gets loaded! The tests/ subdirectory of polyglossia makes no attempt to load the files from ../tex, part of the repository you cloned; instead, it just loads whatever is installed on your system! So you need to install the repository to some texmf dir, and have your latex processor use that texmf dir, for the above change to have effect.

See also an issue about this on GitHub.

einpoklum
  • 12,311
0

I had a version of iftex.sty installed in my path in a different directory than the distribution. Erasing the version that was not part of the distribution fixed the problem. There was a LaTeX Warning about iftex versions before the ifluatex error.