1

The following error seems to pop up on many BasicTeX distributions lately when using fontspec with xelatex or lualatex (see e.g. here, here, here or here):

/usr/local/texlive/2016basic/texmf-dist/tex/latex/base/tuenc.def:252: Missing \endcsname inserted.

Here's a MWE to reproduce this issue (both xelatex and lualatex yield the same error):

\documentclass{article}

\usepackage{fontspec}

\begin{document}
This is a test.
\end{document}

The problem seems to be related to an old version of LaTeX and seems to have started when the fontspec package was updated at some point. I keep my distribution up to date with tlmgr. I have never installed any local formats (that is I have never run fmutil or fmutil-sys), and I have completely removed ~/Library/texlive. All this happens on a fresh install of macOS Sierra. I have also completely reinstalled BasicTeX, but nothing solves this issue.

Here are the versions of pdflatex, xelatex, and lualatex just in case this might be relevant:

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex)

This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016) (preloaded format=xelatex)

This is LuaTeX, Version 0.95.0 (TeX Live 2016)

Also, each binary reports the following version of LaTeX2e (not sure if this is important, but it's a 2016 date):

LaTeX2e <2016/03/31>

Update

I figured out where the problem occurs by reinstalling everything. After installing BasicTeX, everything works. However, updating TeX results in an error message.

First, this works fine:

sudo tlmgr update --self

Next, I update all packages with:

sudo tlmgr update --all

This gives me an error somewhere down the packages:

[61/78, 00:27/00:27] update: xebaposter [12k] (39709 -> 42046) ... done
[62/78, 00:28/00:28] update: xecjk [124k] (41129 -> 43308) ... done
tlmgr: inconsistency on (one of) the server(s): 
http://mirror.easyname.at/ctan/systems/texlive/tlnet
tlmgr: tlp for package xepersian cannot be found, please report.
[63/78, 00:28/00:28] update: xetex [47k] (40963 -> 41438) ... done
[64/78, 00:28/00:28] update: xetexko [56k] (40374 -> 43173) ... done

And still further down:

[76/78, 00:30/00:30] update: collection-xetex [1k] (40404 -> 43059) ... done
[77/78, 00:30/00:30] update: scheme-small [1k] (41261 -> 41825) ... done
tlmgr: action update returned an error; continuing.
tlmgr: package log updated: /usr/local/texlive/2016basic/texmf-var/web2c/tlmgr.log
running mktexlsr ...
done running mktexlsr.
running updmap-sys ...
done running updmap-sys.
regenerating fmtutil.cnf in /usr/local/texlive/2016basic/texmf-dist
tlmgr: An error has occurred. See above messages. Exiting.

I guess this explains why the formats were not updated. It's not this particular mirror, because I get the same error with a different one.

cbrnr
  • 141
  • It's a 2016 date (2016/03/31). Yes, a lot of Mac people do see this error, and so far I haven't seen a fix. I have no idea why tuenc.def was updated but latex (or whatever package is affected) is not. – cbrnr Mar 14 '17 at 12:12
  • your latex will be updated look in whatever kpsewhich latex.ltx says and check around line 699 it should say \edef\fmtversion {2017/01/01} in which case the question is why isn't your format updated. If the latex source still says 2016 then the (different) question is how come that didn't get updated. You are lucky really that change happened to make an error in a recent release as otherwise you silently miss the fact that all updates are broken (you are 7 latex releases behind ctan) – David Carlisle Mar 14 '17 at 12:15
  • You could run xelatex/lualatex with the option --recorder and then check in the .fls-file where your format is from. – Ulrike Fischer Mar 14 '17 at 12:17
  • The .fls file says that everything is from the global texlive folder, e.g. INPUT /usr/local/texlive/2016basic/texmf-dist/tex/latex/base/tuenc.def. – cbrnr Mar 14 '17 at 13:14
  • In the correct latex.ltx it says \edef\fmtversion {2017/01/01}. – cbrnr Mar 14 '17 at 13:16
  • And where is your format (the file with .fmt at the end) according to the fls? It is quite improbable that it is in texmf-dist too. – Ulrike Fischer Mar 14 '17 at 13:37
  • Correct, this file lives in /usr/local/texlive/2016basic/texmf-var/web2c/xetex/xelatex.fmt. – cbrnr Mar 14 '17 at 13:45
  • 1
    you need to rebuild your formats fmtutil-sys --all should be enough but I have no idea why the formats were not remade when latex was updated. – David Carlisle Mar 14 '17 at 16:53
  • is it just xelatex that did not get rebuilt? do pdflatex and lualatex show 2017 dates or did they also not get built when the latex source updated on your machine? – David Carlisle Mar 14 '17 at 16:56
  • @DavidCarlisle how do I get these version numbers? To me, it seems like a serious bug because it occurs right out of the box on a vanilla install of BasicTeX... – cbrnr Mar 15 '17 at 07:57
  • it may be a bug but it's a bug in the installation not in the distributed packages. That doesn't mean it's your bug it may be a bug in the way mactex basic is packaged, but from here I really can't tell. But you have presumably being getting the latex sources for the last 7 releases but not using a latex format built from those sources. as for how do you get the versions for pdftex and luatex I just mean run pdflatex on any document and report what date it puts in the banner. – David Carlisle Mar 15 '17 at 08:05
  • have you run fmtutil-sys --all did it fix the problem? – David Carlisle Mar 15 '17 at 08:06
  • Alright, sudo fmutil-sys --all did fix the problem, thanks! I've added the versions at the bottom of my question. It's almost certainly not a bug in the packages because this seems to be a Mac-specific issue. Now the question is if and how to report this issue... – cbrnr Mar 15 '17 at 08:36
  • I found the error during the package update process - I've added some info directly to the question. – cbrnr Mar 15 '17 at 12:10
  • this happened on texlive under linux as well, after I ran tlmgr install --reinstall latex latex-bin ucs trying to get something else fixed. Ran into the OP described error, running fmutil-sys --all fixed it. – Ahmed Masud Mar 30 '17 at 01:55

0 Answers0