I have just updated my MikTeX installation to 2.9.6942 and Tex Studio to 2.12.14. I'm running on Windows 10 64-bit. The following code is in just about everything I write in LaTeX and it now breaks


\setmainfont{Times New Roman}

From the log in TeX Studio:

Undefined control sequence. \setmainfont{Times New Roman}

From the output messages:

Couldn't open `Times New Roman{}{}{.cfg' hbf2gf (CJK ver. 4.8.4)

From the actual log file:

! Undefined control sequence.
\__fontspec_init_ttc:n #1->\str_if_eq:eeT 
                                          {\str_lower_case:f {\l__fontspec_e...
l.4 \setmainfont{Times New Roman}

Everything is up to date, Times New Roman is installed, and I have successfully used it like this in versions past (MikTeX 2.9.6161). All L3 packages are installed as well. How do I get fontspec to work again?

  • Update l3kernel – Will Robertson Feb 18 '19 at 3:18
  • @WillRobertson l3kernel, l3packages, and l3experimental are all installed (according to MikTeX Console). Is there something else I need to do to update them? – Blake Lucas Feb 18 '19 at 4:15
  • 1
    Sorry for my terse reply above, was in a rush. Sorry to hear you had to go to rather extreme lengths to fix the problem... – Will Robertson Feb 18 '19 at 10:29

In case anyone runs in to this problem: l3kernel and the associated packages were up to date in MikTeX, but old libraries were still present in folders like AppData. Once I uninstalled MikTeX, purged the old files, and reinstalled, it worked fine.

| improve this answer | |
  • 1
    When you use miktex you always update as admin and as user, then both gets updated – daleif Feb 18 '19 at 7:43
  • See also tex.stackexchange.com/q/55437/35864 and tex.stackexchange.com/q/108447/35864. On multi-user installations of MikTeX updates should usually be performed in both admin and user mode to avoid issues like this. That is one of the reasons why some people recommend single-user installations. – moewe Feb 18 '19 at 13:09

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.