I’m trying to use Travis + pandoc to automatically reproduce (and eventually auto-release via Github Pages) an R analysis and related Markdown report. I normally use lualatex as the latex engine, so that I can easily switch out the font and don’t have to stare at Computer Modern all the time. But using lualatex in Travis seems to cause some kind of font error, even if I don’t change the font.
pandoc paper.md -o paper.pdf --pdf-engine=lualatex
Error producing PDF.
! Font \TU/lmr/m/n/10=[lmroman10-regular]:+tlig; at 10pt not loadable: metric da
ta not found or bad.
<to be read again>
relax
l.105 \fontencoding\encodingdefault\selectfont
(.travis.yml and paper.md have some elements relevant to a pandoc filter, pandoc-crossref. I was debugging that earlier today and don’t feel like creating a whole new MWE for this issue, so I disabled or removed everything that depends on this filter.)
Here are the suggested incantations I found scattered in that question:
sudo apt-get install fonts-lmodern
sudo tlmgr install luaotfload
luaotfload-tool --update
sudo apt-get install texlive-luatex
As I understand Travis, apt-get installations are turned into a list and go under addons:apt:packages and tlmgr calls go under before_install. Without sudo of course.
None of these seems to fix the problem.
luaotfload-tool --update raises the error /home/travis/texlive/bin/x86_64-linux/luaotfload-tool:74: unexpected symbol near '/'. The other three (tried in various combinations) all return the same font error.
(Also, note that Google reorders search results for each user, trying to optimize clicks. So the order you see doesn’t necessarily correspond to the order I see.)
before_install:
- tlmgr update --all || true # one package fails to update but that doesn't affect the outcome
- tlmgr install unicode-math lualatex-math pdftexcmds infwarerr luaotfload
- luaotfload-tool --update
cat -n $(which luaotfload-tool) shows that it’s a luatex script and uses the floor division operator //which is new in Lua 5.3 while the stock luatexuses 5.2. So you need to update luatex to run it. I do confirm that luaotfload-tool --update fixes the font issue once it works.
The rest of the installs/updates are to fix unrelated failures after that.
Teaching in Fall 2020 has been A Thing, but I’ve finally found the time to come back to this thread and confirm that the workaround works for my production case