After an update of all my packages, the upgrading from my old MiKTeX 2.9 to the last version, and the refreshing of the file name database (FNDB), my tex file wouldn’t compile anymore. I identified the problem as coming from the fontspec package which worked perfectly fine right before updating everything. When running, the compilation stops first on the following lines:

Package: fontspec 2019/03/15 v2.7c Font selection for XeLaTeX and LuaLaTeX
! Undefined control sequence.
l.27 \sys_if_engine_luatex:T

If I force to run though, I get several other errors which appear in the log file below. No PDF file emerges from the process.

I tried to uninstall (and deleting all files left) then to reinstall my MiKTeX distribution several times with 64 bits and 32 bits versions in case I did it wrong but it did not change anything to my problem.

I also checked with other packages as the one linked to the LaTeX2ε and LaTeX3 as it seemed to be in this topic but installing, uninstalling and reinstalling the packages l3kernel and l3packages had no effect on the compilation. This temporary solution from 2013 had no effect neither.

Ater several tests, I also found out that other packages seemed to be affected by my issue: polyglossia (as it works partly upon the fontspec package), the manyfoot package and the perpage package. For the manyfoot and perpage packages, I am not sure if it is related to the fontspec package althought it also worked fine before any update. It seems to me that the core issue stands with the fontspec package.

Any idea of how I could fix that issue?

I am using MiKTeX 2.9.7050 (32bits) and Texmaker 5.0.3 on Windows 10. Here is a M(N)WE:

Hello world!

And here is the log file until the first error (I may not post the whole log file which looks like a spam to the forum):

L3 Module: l3box 2014/08/23 v5354 L3 Experimental boxes
L3 Module: l3coffins 2014/08/23 v5354 L3 Coffin code layer
L3 Module: l3color 2014/08/23 v5354 L3 Experimental color support
L3 Module: l3candidates 2014/11/23 v5466 L3 Experimental additions to l3kernel
File: l3unicode-data.def 2014/11/23 v5465 L3 Unicode data
File: l3xdvidpfmx.def 2014/11/23 v5466 L3 Experimental driver: xdvipdfmx
Package: xparse 2014/11/25 v5471 L3 Experimental document command parser
Package: fontspec 2019/03/15 v2.7c Font selection for XeLaTeX and LuaLaTeX

! Undefined control sequence.
l.27 \sys_if_engine_luatex:T
  • 2
    Welcome to TeX.SX! It looks like your version of fontspec is quite recent (2019/03/15), but your l3kernel is very old (2014/11/23). You need to update l3kernel. – Phelype Oleinik Jul 20 at 19:41
  • Do you have an admin installation? Did you update as admin and as user? – Mensch Jul 20 at 19:52
  • @PhelypeOleinik I did try to update the l3kernel. I did uninstall then reinstall it from the MiKTeX console as an admin. The console indicates, indeed, that the package was "packaged on 12-12_2014". So I uninstalled them then used the tds.zip files from CTAN to install them semi-manually but it didn't change anything. Would the tds.zip be outdated? Do you think I should try to install the two packages by running latex on every dtx file? There are like 40 or 60 and the documentation is not really extensive on where to place them in my MiKTeX location tree. – Mosley Jul 21 at 8:50
  • @Mensch I do have an admin installation and I did update everything as an admin. It does not seem possible to update my packages as a common user after updating as an admin? – Mosley Jul 21 at 8:50
  • It is, first open MiKTeX Console, choose use as admin, update. Then change to your user account, open MiKTeX Console, choose use as user and update ... Do that always you have to update MiKTeX ... – Mensch Jul 21 at 11:55

At last it seems to me that you updated an very old version of MiKTeX which is already mentioned on the homepage of MiKTeX to can result in errors.

In your case it seems your MiKTeX system is corrupted and I would recommend to deinstall it completly (and TeXmaker too), then download the current complete installer from the homepage and install new. Why do you use a 32bit software (MiKTeX) on a 64bit system? Better use the 64bit version of MiKTeX: Go to https://miktex.org/download, click on all downloads and choose the net installer 64bit. After installing MiKTeX install the current TeXMaker too (then it should recognise the new MiKTeX and be able to call and use it).

With the following mwe (please see added command \listfiles to get a list of all used packages and version numbers in the log file)

% xelatex


Hello world!

I can compile with my current MIkTeX XeTeX, Version 3.14159265-2.6-0.999991 (MiKTeX 2.9.7050 64-bit) (preloaded format=xelatex 2019.2.5) without any errors or warnings an get the following list of used packages:

 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2018/09/03 v1.4i Standard LaTeX file (size option)
fontspec.sty    2019/03/15 v2.7c Font selection for XeLaTeX and LuaLaTeX
  xparse.sty    2019-05-28 L3 Experimental document command parser
   expl3.sty    2019-07-01 L3 programming layer (loader) 
expl3-code.tex    2019-07-01 L3 programming layer 
l3backend-xdvipdfmx.def    2019-04-06 v L3 Experimental backend support: xdvipdfmx
fontspec-xetex.sty    2019/03/15 v2.7c Font selection for XeLaTeX and LuaLaTeX
   tuenc.def    2018/08/11 v2.0j Standard LaTeX file

As you can see your used version for expl3.sty is simply too old.

I guess you did some changings on your MiKTEX system as admin, some as user and this causes your culprit.

  • I did a complete clean installation of MiKTeX (64bits) then a new installation of Texmaker (64bits) but I still had difficulties. Then I made a new clean installation of Texmaker after I tracked down all left files related to the program. I assume you were totally right by talking about corrupted distribution as part of the problem. The problem was fully resolved when the new Texmaker made a real clean config when it couldn't find any old config file. The file list is now up to date and the compilation runs smoothly. – Mosley Jul 21 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.