pandoc / dockerfiles

Dockerfiles for various pandoc images
GNU General Public License v2.0
364 stars 98 forks source link

Getting font installation errors when using pandoc/extra docker image with the `--template eisvogel` option #216

Closed raven42 closed 4 months ago

raven42 commented 1 year ago

I'm trying to use the pandoc/extra docker image with the eisvogel template and running into an issue when it is trying to get the necessary fonts.

$ docker run --rm --volume "$(pwd):/data" --user $(id -u):$(id -g) pandoc/extra:3.1.1.0 input.md -o output.pdf --template eisvogel
Unable to find image 'pandoc/extra:3.1.1.0' locally
3.1.1.0: Pulling from pandoc/extra
Digest: sha256:cc98998c5ab9a652b5c760d69c2fbf3395e063c6d0519890cd46dc3efbf9031a
Status: Downloaded newer image for pandoc/extra:3.1.1.0

kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 tctt1095
mkdir: can't create directory '././.texlive': Permission denied
mktexpk: /opt/texlive/texdir/texmf-dist/web2c/mktexdir /.texlive/texmf-var/fonts/pk/ljfour/jknappen/ec failed.
kpathsea: Appending font creation commands to missfont.log.

kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 tctt1095
mkdir: can't create directory '././.texlive': Permission denied
mktexpk: /opt/texlive/texdir/texmf-dist/web2c/mktexdir /.texlive/texmf-var/fonts/pk/ljfour/jknappen/ec failed.
kpathsea: Appending font creation commands to missfont.log.
Error producing PDF.
!pdfTeX error: pdflatex (file tctt1095): Font tctt1095 at 600 not found
 ==> Fatal error occurred, no output PDF file produced!

$

I've tried this using the pandoc/extra, pandoc/extra:3.1.1.0, pandoc/extra:3.0, and pandoc/extra:2.19 images and they all produce the same error.

The missfont.log file contains the following:

mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 tctt1095

FYI: I'm running on Ubuntu 20.04.5 LTS with Docker version 20.10.12 (I know, it's old, but it's a work system and this is the supported version).

raven42 commented 1 year ago

When using this image without the --template eisvogel option, then the PDF is created just fine. It appears to be only with this template that I'm seeing this error.

simondueckert commented 1 year ago

I have a similar issue with pandoc/extra: when using "--template eisvogel" within a github action I get an error message that the template file was not found.

daamien commented 1 year ago

@simondueckert: This is another problem. The $HOME variable is messed up in Github Actions. You need to use --template /.pandoc/templates/eisvogel.latex

see https://github.com/pandoc/dockerfiles/issues/212#issuecomment-1652118233

daamien commented 1 year ago

@raven42: can you provide the input.md file you are using or at least the yaml part at the top ?

raven42 commented 1 year ago

The yaml meta data portion is here:

---
title: "Input"
author: David Hegland
date: August 3, 2023
output:
  pdf_document:
    toc: true
    toc_depth: 3
geometry: margin=0.5in
---
raven42 commented 1 year ago

Ok I've been able to isolate it to using back-quotes within a code block. Using this content produces the error.

---
title: "Input"
author: David Hegland
date: August 3, 2023
output:
  pdf_document:
    toc: true
    toc_depth: 3
geometry: margin=0.5in
---

# Heading 1
Paragraph 1

**Code Block with tick marks**

Some block of code

raven42 commented 1 year ago

@daamien any ideas on this?

daamien commented 4 months ago

Fixed

Sorry for the long wait