Pandoc + lualatex font error

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.

Travis log: https://travis-ci.org/github/dhicks/pandoc-crossref-travis-text
Github repo: https://github.com/dhicks/pandoc-crossref-travis-text

Here’s the pandoc call and error message:

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.)

Attn: @jeroen and @jimhester

(2nd in Google on “pandoc “metric data not found or bad””)

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.

Current Github commit: https://github.com/dhicks/pandoc-crossref-travis-text/tree/4a9d28ac5c65f2bb4493748e0053e6e4c3ae61fd
Travis log for that commit: https://travis-ci.org/github/dhicks/pandoc-crossref-travis-text/builds/711952124

(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.)

@jeroen @jimhester It look like the TexLive bundle at https://github.com/jimhester/ubuntu-bin/releases/download/latest/texlive.tar.gz has missing/outdated dependencies for pandoc, even the default version.

Could you consider updating it (see the workaround below), or at least tell your stance on this issue?

P.S. since the OP’s repo has a small test document, it could be used as a test for the bundle.


@dhicks The workaround that I confirm to work is:

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 luatex uses 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