1

Here's my MWE (it's really M, as the content isn't too relevant):

% !TEX TS-program = xelatex
\documentclass{article}
\usepackage{fontspec}
\begin{document}

\end{document}

Since I migrated to TeX Live 2016 (I'm fairly certain that's when this behaviour started), this document takes some ten minutes to process.

I believe it's because XeLaTeX is rebuilding the font cache every time it runs.

Before this started, an occasional ....TeX run would pause for the cache rebuild, but after that, further runs of any document would go quickly.

I am not seeing this behaviour with LuaLaTeX.

Here is a piece of the TeX log file. I have inserted three exclamation points (!!!) at the exact point (as far as I can determine) at which the pause occurs:

Package: fontspec 2016/02/01 v2.5a Font selection for XeLaTeX and LuaLaTeX

(d:/Programs/TeX.Live/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
Package: fontspec-xetex 2016/02/01 v2.5a Font selection for XeLaTeX and LuaLaTe
X
... (fontspec macro dump)

(d:/Programs/TeX.Live/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2016/06/19 v1.99m Standard LaTeX package

(d:/Programs/TeX.Live/texmf-dist/tex/latex/euenc/eu1enc.def
File: eu1enc.def 2010/05/27 v0.1h Experimental Unicode font encodings
)
LaTeX Font Info:    Try loading font information for EU1+lmr on input line 105.


(d:/Programs/TeX.Live/texmf-dist/tex/latex/euenc/eu1lmr.fd
File: eu1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
)!!!)        <=== Here, at some point in fontenc.sty
(d:/Programs/TeX.Live/texmf-dist/tex/xelatex/xunicode/xunicode.sty
File: xunicode.sty 2011/09/09 v0.981 provides access to latin accents and many 

Any ideas, please?

6
  • 2
    Try if it helps if you run fc-cache (with or without the options -f or -r) Commented Sep 1, 2016 at 18:46
  • 1
    there's been a very extensive discussion about this on the tex-live mailing list -- 60 messages between last saturday (august 28) and yesterday. i think @UlrikeFischer's comment boils it down to what was finally recommended. (and if i understood the tex-live discussion correctly, yes, the font cache does get rebuilt with every xetex run if something new was added recently. that can be co-opted by rebuilding the cache manually before launching the xetex run.) Commented Sep 1, 2016 at 20:21
  • 1
    @barbarabeeton Do you mean that if something new is added, then, until fc-cache is run, XeTeX will rebuild on every compilation? But why would fc-cache not have been run system-wide if something new was added? I realise that stuff happens and things go wrong, but it seems weird for that many people to get bitten by something which depends on a step required for proper system configuration to be skipped.
    – cfr
    Commented Sep 1, 2016 at 22:44
  • 1
    @cfr -- windows is where the slowdown was first reported. Commented Sep 1, 2016 at 23:52
  • 1
    @barbarabeeton Thanks. I always forget Windows uses this. Just it would be quite hard for me to add new fonts and avoid fc-cache being run. (Probably the exception is if a TeX Live update installed new TTF/OTF, but that's much less common and would be cancelled out next time any other fonts were installed or updated or whatever. And that's only an issue because I use upstream but added system integration on top. I.e. it wouldn't happen by default.) But if it is Windows, I have no idea about anything and wouldn't have commented ;).
    – cfr
    Commented Sep 2, 2016 at 0:01

2 Answers 2

2

By experiments, I found that the renaming,

cachefile.NEW --> cachefile

almost always fails if executed from the XeTeX binary even in a user's writable directory. Thus if you find a delay of time, run

fc-cache -v

If messages

invalid cache file: ...

are shown, run

fc-cache -v

once more. It seems that this is the solution, as Ulrike stated.

1
  • I would still be very wary of setting up anything font related on a user-specific basis in TeX Live .
    – cfr
    Commented Sep 2, 2016 at 12:10
1

I'm most grateful for all the suggestions. How I actually fixed it was thus: I deleted everything in

(TeXLiveRoot)/texmf-var/fonts/cache

(except readme.txt), and tried again.

On the first run (of course?) XeTeX rebuilt the cache; thereafter it ran normally.

1
  • @AkiraKakuto Yes, I accept that. However, I did install TeX Live in Administrator mode, and for all users. On reflection, I think that may have been the source of my problem. Commented Sep 2, 2016 at 18:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .