I wonder if there's a way to use pandoc's LaTeX image with LuaLaTeX and TeX Gyre Fonts.
I tried setting up this Dockerfile:
FROM pandoc/latex:2.11.1.1
RUN apk add --no-cache \
chromium \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont \
nodejs \
yarn \
ttf-ubuntu-font-family
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser \
PATH="/data/node_modules/.bin:${PATH}"
# Add user so we don't need --no-sandbox.
RUN addgroup -S pptruser && adduser -S -g pptruser pptruser \
&& mkdir -p /home/pptruser \
&& chown -R pptruser:pptruser /home/pptruser \
&& chown -R pptruser:pptruser /data
# Puppeteer v5.1.0 works with Chromium 84.
RUN yarn add eslint puppeteer mermaid-filter
# Install Tex Gyre Termes font
RUN tlmgr install tex-gyre tex-gyre-math
# Install Noto Color Emoji
RUN mkdir -p /usr/share/fonts/truetype/noto \
&& cd /usr/share/fonts/truetype/noto \
&& fc-cache -fv
# Run everything after as non-privileged user.
USER pptruser
WORKDIR /home/pptruser
COPY src/puppeteerConfigFile.json /home/pptruser/.puppeteer.json
When I want to use compile a markdown file to PDF with LuaLaTeX as the PDF engine with mainfont: TeX Gyre Termes at the top, I got the following error.
This is LuaHBTeX, Version 1.12.0 (TeX Live 2020)
restricted system commands enabled.
(./201113-TAM-compte-rendu.tex
LaTeX2e <2020-10-01> patch level 2
luaotfload | load : FATAL ERROR
luaotfload | load : × Failed to load "fontloader" module "basics-gen".
luaotfload | load : × Error message:
luaotfload | load : × "...dir/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua:306: system : no writeable cache path, quiting".
stack traceback:
...dir/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua:174: in local 'load_fontloader_module'
...dir/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua:308: in upvalue 'init_main'
...dir/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua:560: in function 'luaotfload-init.lua'
...dir/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua:298: in field 'main'
[\directlua]:1: in main chunk
...dir/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua:306: system : no wr
iteable cache path, quiting
stack traceback:
[C]: in function 'error'
...dir/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua:306: in function '
os.exit'
...dir/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua:177: in local 'loa
d_fontloader_module'
...dir/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua:308: in upvalue 'i
nit_main'
...dir/texmf-dist/tex/luatex/luaotfload/luaotfload-init.lua:560: in function '
luaotfload-init.lua'
...dir/texmf-dist/tex/luatex/luaotfload/luaotfload-main.lua:298: in field 'mai
n'
[\directlua]:1: in main chunk.
<everyjob> ...ring \\def\string \\encodingdefault{OT1}')end }
\let \f@encoding \encoding...
l.1
% Options for packages loaded elsewhere
I tried searching for a way to fix this, but I couldn't find a successful example.
In pandoc's LaTeX image, TeXLive 2020 is installed under /opt/texlive/, whose write access requires root privileges. I wonder if there's a way to use TeX Gyre * fonts with LuaLaTeX as the PDF engine.