Tectonic
Ever since it has been included as pandoc tex rendering engine, it might be desirable to implement a tectonic pandoc dockerfile variant. Lukily enough, there is a quite recent alpine package.
I haven't tried tectonic, yet, but some of it's choice promise less pain down the road. I'm copying:
- automatically downloads support files
- completely reproducible document compiles
- doesn’t write TeX’s intermediate files (speed!!!)
- modern OpenType fonts and is fully Unicode-enabled (xetex)
- completely self-contained library
-
developed in the open in
rust
Eureka: https://github.com/vinay0410/tectonic-docker !
Cool! I haven't seen tectonic before, it looks very interesting.
So I think, we would inherit from the tectonic image rather than base Alpine. Does that make sense?
We need to make some design decisions e.g. Ubuntu image, so incorporation of tectonic should be done in consideration (should be possible, but may have different structure e.g., base image is Ubuntu).
Do we need to worry about people using both TeX and tectonic?
So I think, we would inherit from the tectonic image rather than base Alpine. Does that make sense?
I think, and since there is ans alpine package compiled, it might be simpler to just apk add tectonic and do some pandoc specific cache seeding. It should be a dead simple image. If we shall need a more updated build, doing so with a builder image is also straight forward, but above all, transparent.
Re ubuntu If debian, then a
debian-x-slimimage to reduce size. Ismuslibcreally such a pain?!?
Do we need to worry about people using both TeX and tectonic?
Good quesion. Textonic Typesetting seems to be a (pronouncable) xetex flavour. But I'm not sure if it's designed to be a drop in replacement (it doesn't explicitly guarantee that). I guess this depends mostly on the choices pandoc itself has made in his defalut.latex - and if that does influence. But in sight of the people that reportedly build and support tectonic, I'd argue that, eventually and gradually (and hopefully), the ecosystem moght converge to tectonic.
Just wanted to give you a quick update, @tarleb and I are going to jump on a call soon and map out what needs to happen where (we're kind of cross-stalled), we'll establish the most appropriate way to handle tectonic. It may just end up in the core image, specifically because it's a comparatively small install size (in contrast to e.g., #60). This would also make it so that it's available in the TeX image as well, by default, though it does seem that's not really a big concern.
In the meantime, would you be willing to take a look at the existing tests and try and flesh out if we can just reuse those with a new writer or if we need to add new ones? (I'm most concerned about bibliography / reference stuff with tectonic, we want to make sure that works!).
For development convenience (avoid rebuilding all of pandoc),
-
Create a child image from
coreARG base_tag="latest" # NOTE: depending on results, we may actually need pandoc/latex:${base_tag} FROM pandoc/core:${base_tag} RUN apk add tectonic -
Add an
alpine-tectonictarget somewhere around this onehttps://github.com/pandoc/dockerfiles/blob/ff2f4e3f850501657b324868b1f0b81fefa97551/Makefile#L34
Something like (assuming you put that in
{root}/alpine/tectonicfolder and file namedDockerfilealpine-tectonic: docker build \ --tag pandoc/tectonic:$(PANDOC_VERSION) \ --build-arg base_tag=$(PANDOC_VERSION) \ -f $(makefile_dir)/alpine/tectonic/Dockerfile $(makefile_dir) -
Add a test target, compare existing test targets (note the magic
IMAGEsetting per-target).
The development is basically PANDOC_VERSION=X make alpine-tectonic followed by PANDOC_VERSION=X make test-alpine-tectonic. So with infrastructure in place, e.g., PANDOC_VERSION=latest make alpine-tectonic.
If it is easier for you, you can open a PR! But there will likely be some significant infrastructure changes as a result of our planning conversation, so don't worry too much about it being "perfect", more just an exploratory experiment on getting the testing side for tectonic up to speed, we'd be very grateful for the help! :heart:
Selfishly, I hope that tectonic emerges as the victor in the ongoing tex splintering hehe. It seems super convenient.
If debian, then a debian-x-slim image to reduce size. Is muslibc really such a pain?!?
Yes, it really is. Primarily because of general lack of support by things that work fine with glibc. On the ubuntu side, we will target a core LTS release. The ubuntu image will be less focused on size, but more for general ease and convenience -- the image is generally larger, but widespread use makes it much less error prone for certain disciplines (thinking of R, data science stuffs, etc) :slightly_smiling_face:
I've put a note on a paper in front of my desk.
As discussed with @tarleb on Twitter: There is this great GitHub action to set up the latest tectonic version with caching and biber https://github.com/WtfJoke/setup-tectonic. This might be a good starting point to create a custom pandoc-tectonic image. Let me know if I can support you.