Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To LaTex Or Not To LaTeX #1

Closed
svenevs opened this issue Jan 30, 2019 · 3 comments
Closed

To LaTex Or Not To LaTeX #1

svenevs opened this issue Jan 30, 2019 · 3 comments

Comments

@svenevs
Copy link
Member

svenevs commented Jan 30, 2019

Continuation of discussion here

I very strongly feel that a base pandoc + minimal latex docker image should be officially maintained (and am happy to help maintain it!). I just don't know how to build out the layering scheme...

I've spent a lot more time on this than I originally intended, and have come to the conclusion that maintenance of a pandoc + latex image is neither worth the pain nor the effort. The real meal ticket here is that these docker files have an easy way of getting pandoc. Here's why

Adventures With Manual Install

The install-tl approach is much slower with minimal gain in my opinion. The basic scheme for latex is missing a lot that I'm pretty sure will affect pandoc output. I didn't test on simple documents, but for a local repo here with -t beamer I ended up needing to install about 20 additional packages before I could compile the slides. I did bring in some fancy stuff (like minted), but by and large this will be every user's experience.

Worst, I think I found a bug that I couldn't actually solve on alpine. When you tlmgr install biber there is no biber executable installed. It installed biblatex, bibtex, all of the other ones. But reliably no biber, which will be a big hurdle for people using latexmk + pandoc-citeproc I think. At least it was for me.

Reference point: image took 6 minutes 38 seconds to build on top of tarleb/alpine-pandoc:2.5, producing an uncompressed image size of 622MB.

Just use apk add

When trying to solve biber problem I noticed that it was available from apk, and I tested two things since mixing the install-tl and apk add biber didn't work (install-tl produced biblatex too new for packaged biber):

FROM tarleb/alpine-pandoc:2.5

# Version 1:
RUN apk add --no-cache texlive

# Version 2: basically texlive-full minus texlive-doc minus texlive-dev
# see: https://pkgs.alpinelinux.org/package/edge/community/x86_64/texlive-full
RUN apk add --no-cache texlive texlive-dvi texlive-luatex texlive-xetex xdvik

With docker system prune -a in between all of these tests:

  • Version 1 takes 2 minutes 38 seconds to build x 814MB uncompressed
  • Version 2 takes 3 minutes 9 seconds to build x 861 MB

Analysis

Alpine packaged latex very well, you still get tlmgr. Similarly, the basic install for install-tl is so stripped down that people will be forced to encounter the world of dependency satisfaction with LaTeX. Noting that tlmgr install XXX may only be part of it, things like images typically need other libraries.

Either way (622MB or 814MB), these images are getting big enough that they will be cumbersome to download.

Solution: provide suggestions in the README for what people need to do to get texlive. The path of least resistance is to use system package managers. Sometimes system package managers add too much stuff, but it's going to be stable, and downloads will actually be faster than install-tl.

To be honest I'm pretty dissatisfied with these results, but the upshot is that the layering scheme becomes transparent again: only provide pandoc/distro images. pandoc/alpine is just alpine plus pandoc, nice and simple.

This issue can be closed or discussed. If people agree with abandoning pandoc + latex images, I can add a pull request with documentation on the README with suggested approach for installing latex in their own container.

@tarleb
Copy link
Member

tarleb commented Jan 30, 2019

With Markdown→LaTeX being a popular work-flow, support for this seems imporant. Ideally, the image would contain all packages mentions in pandoc -D latex, plus some bib helpers. If the easiest way is to use apk, then let's do that. Convenience beats minimalism, and ~⅗GB to ⅘GB is not too bad. We can still try to improve on this later on.

@jgm
Copy link
Member

jgm commented Jan 30, 2019 via email

@svenevs svenevs mentioned this issue Jan 31, 2019
@dargmuesli
Copy link

Just wanna leave a big "thank you" here. It's great to see you working on an official Pandoc Docker image! <3

@tarleb tarleb closed this as completed in #3 Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants