pandoc / dockerfiles

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

! LaTeX Error: File `epsf.sty' not found. #211

Closed argenos closed 1 year ago

argenos commented 1 year ago

Similar to https://github.com/pandoc/dockerfiles/issues/135, I am using some level of nesting and trying to build a PDF using latex.

Error producing PDF
! LaTeX Error: File `epsf.sty' not found.

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

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

l.3 \usepackage

Is it possible to add epsf.sty to either pandoc/extra or pandoc/latex?

Thanks!

jgm commented 1 year ago

You'd have to add this to your latex installation if you want to use it. This is not a pandoc issue.

alerque commented 1 year ago

@jgm Did you perchance overlook that this is the Pandoc Dockerfiles repository not the Pandoc one? Whether or not we opt to include this package or not, the issue seems relevant here.

jgm commented 1 year ago

Sorry, I did overlook that!

daamien commented 1 year ago

@argenos : The CTAN page says the espf package is now obsolete and deprecated. See link below.

https://ctan.org/pkg/epsf?lang=en

Can you provide more context for your use case ? Why do you need it ? Have you tried to used latex-graphics instead ? Do you use a custom template ?

alerque commented 1 year ago

Given that upstream explicitly (in their own words "rather strongly" deprecated this and we already bundle the replacement, I think I'm going to close this as "not planned". That's not to say that discussion is closed though, just that baring more information or consensus that's the direction we're headed. If there is further feedback about why this would be generally useful to be baked in the default images feel free to comment.

You can build an image with the packages you need included either by modifying the original generation script to add your package or just using the existing Docker images as a base and running tlmgr install to add more packages in a new Docker layer. Both ways are pretty low friction to get an image exactly suited to your project(s) and the results can be placed on any Docker container registry and re-used.

argenos commented 1 year ago

Sorry for the late reply! I did notice it was deprecated. However, since I don't "own" the template, I just have to use it, it was unclear if I could actually remove those packages. The good news is that I managed to use this in GitHub actions, and I'm adding it to this issue in case someone gets here from Google. This might be a nice example to add to the README too.

The solution was to use Pandoc scripts, where the script calls tlmgr install <packages....> and then pandoc, for example:

#!/bin/sh
echo "Installing missing latex packages!"
tlmgr install collection-fontsrecommended
pandoc README.md

And my GitHub action uses that script (pandoc.sh) as an entrypoint and looks like this (it can be simplified, but I left it almost as I used it in case anything else might be useful to add in the examples):

name: Convert deliverables

on: push
env:
  TEXINPUTS: ".:docs/d3.3/pandoc/:docs/d3.3/:docs/images/:docs/:"

jobs:
  convert_via_pandoc:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: true

      - uses: docker://pandoc/extra:3.1.1
        with:
          entrypoint: "docs/d3.3/pandoc.sh"

      - uses: actions/upload-artifact@v3
        with:
          name: d3_3.pdf
          path: docs/d3.3/d3_3.pdf