# Pandoc + lualatex font error

**URL:** <https://travis-ci.community/t/pandoc-lualatex-font-error/9409>\
**Category:** R\
**Created:** [July 21, 2020, 10:26pm UTC](https://travis-ci.community/t/pandoc-lualatex-font-error/9409 "2020-07-21T22:26:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhicks](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@dhicks](https://travis-ci.community/u/dhicks)\
**Post date:** [July 21, 2020, 10:26pm UTC](https://travis-ci.community/t/pandoc-lualatex-font-error/9409/1 "2020-07-21T22:26:38Z")

</div>

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](https://travis-ci.org/github/dhicks/pandoc-crossref-travis-text)  
Github repo: [https://github.com/dhicks/pandoc-crossref-travis-text](https://github.com/dhicks/pandoc-crossref-travis-text)

Here’s the pandoc call and error message:

```auto
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

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [July 25, 2020, 5:17pm UTC](https://travis-ci.community/t/pandoc-lualatex-font-error/9409/2 "2020-07-25T17:17:10Z")

</div>

> <https://tex.stackexchange.com/questions/378488/font-tu-lmr-m-n-10-lmroman10-regulartlig-at-10pt-not-loadable>

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

---

<div class="post-metadata">

**Author:** ![dhicks](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@dhicks](https://travis-ci.community/u/dhicks)\
**Post date:** [July 26, 2020, 3:56pm UTC](https://travis-ci.community/t/pandoc-lualatex-font-error/9409/3 "2020-07-26T15:56:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [July 26, 2020, 6:35pm UTC](https://travis-ci.community/t/pandoc-lualatex-font-error/9409/4 "2020-07-26T18:35:49Z")

</div>

@jeroen @jimhester It look like the TexLive bundle at [https://github.com/jimhester/ubuntu-bin/releases/download/latest/texlive.tar.gz](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](https://travis-ci.com/github/native-api/pandoc-crossref-travis-text/builds/177203419) is:**

```bash
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

```

* * *

> [@dhicks](#):
>
> `linux/luaotfload-tool:74: unexpected symbol near '/'`

`cat -n $(which luaotfload-tool)` shows that [it’s a `luatex` script](https://travis-ci.com/github/native-api/pandoc-crossref-travis-text/builds/177200465#L761) and [uses](https://travis-ci.com/github/native-api/pandoc-crossref-travis-text/builds/177200465#L834) the floor division operator `//` [which is new in Lua 5.3](https://www.lua.org/manual/) while the stock `luatex` [uses 5.2](https://travis-ci.com/github/native-api/pandoc-crossref-travis-text/builds/177201876#L2448). 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.

---

<div class="post-metadata">

**Author:** ![dhicks](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@dhicks](https://travis-ci.community/u/dhicks)\
**Post date:** [September 14, 2020, 7:52pm UTC](https://travis-ci.community/t/pandoc-lualatex-font-error/9409/5 "2020-09-14T19:52:34Z")

</div>

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
