Wandmalfarbe / pandoc-latex-template

A pandoc LaTeX template to convert markdown files to PDF or LaTeX.
BSD 3-Clause "New" or "Revised" License
6.13k stars 959 forks source link

Issue with pandoc/latex docker image and missing texlive packages #354

Closed raven42 closed 1 year ago

raven42 commented 1 year ago

Looking at the info from https://github.com/Wandmalfarbe/pandoc-latex-template#texlive it looks like there are additional packages required to get this to run. However I am trying to run this build as part of a docker image using the pandoc/latex docker image. When I run it, I am getting the following.

pandoc/latext

I've extracted the latest release at ./templates and using the --data-dir it can find the template fine. But it seems as though the pandoc/latex docker image doen't have all the required packages.

$ docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g` pandoc/latex input.md -o output.pdf --template eisvogel --data-dir .
Error producing PDF.
! LaTeX Error: File `scrartcl.cls' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)

Enter file name: 
! Emergency stop.
<read *> 

l.52 \usepackage

pandoc/extra

I've tried using the pandoc/extra docker image as well, but I'm getting a different error there.

$ docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g` pandoc/extra input.md -o output.pdf --template eisvogel --data-
dir .

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 found issue #238 but that seems to be for a local install. Is there any way to get this to work with the pandoc docker images?

daamien commented 1 year ago

Hi @raven42

Fisrt of all : your questions are related to the Pandoc Docker Images which are maintained by a different project. If you have any further questions about thoses images please open a ticker on the issue board below :

https://github.com/pandoc/dockerfiles/issues

That being said here's some quick answers:

  1. The pandoc/latex image does not contain the packages required by the eisvogel template. The pandoc/extra image is designed specifically for that.

  2. You should not use the --data-dir option with the pandoc/extra, unless you have a very good reason to do so... Did you try to run the command without it ?

As far as I can tell the line below should work:

docker run --rm --volume "`pwd`:/data" --user `id -u`:`id -g` pandoc/extra input.md -o output.pdf --template eisvogel
raven42 commented 1 year ago

@daamien thanks. I'll post over there. Even without using the --data-dir option, I still get the second error I mentioned using the pandoc/extra image. I've opened an issue over there to look into it more.

https://github.com/pandoc/dockerfiles/issues/216