brucemiller / LaTeXML

LaTeXML: a TeX and LaTeX to XML/HTML/ePub/MathML translator.
http://dlmf.nist.gov/LaTeXML/
Other
933 stars 99 forks source link

On demand texlive package/feature installation #1535

Closed dginev closed 1 year ago

dginev commented 3 years ago

I'm sitting at a virtual talk by Yihui Xie on tinytex, where he has implemented a small parser over pdflatex's log messages to detect cases where certain installation prerequisites are missing. For example, as explained in the tugboat article the basic Error: File ‘framed.sty’ not found triggers a handler to install framed.sty via tlmgr. This is a feature I recall is also natively enabled in MikTeX, as part of their visual UI framework and allows a very small 27 MB texlive base installation as a starting point on the machine.

Since we have a variety of cases where we've started to consider/need a containerized latexml installation (e.g. docker #1178 ), some of those cases could benefit from not having to install the full 5+ GB texlive on the droplet running the container. This becomes an obvious need with scale (e.g. sites like Authorea and Overleaf may spin up tens or hundreds of machines running latexml).

The tinytex author openly invited his audience to borrow the logic that detects missing packages and installs them with tlmgr - and obviously latexml already has the capability to know when a dependency is missing (whether it could use it if it was present is a matter of a good enough --includestyles capability, so this issue likely depends on solving #622 first).

It supports limited types of "missing dependencies", e.g. it won't know how to fetch missing fontmaps, or other more exotic bits -- but at the moment those aren't often used by latexml either, and ideally are mostly carried along by tlmgr when their carrier package is requested.

So, what is this issue suggesting? Maybe in cases where --includestyles is turned on, and tlmgr is present on the system, and a missing package warning is triggered, then we try installing the new package and retry loading it, before moving on.

Their exact supported set of messages that flag missing dependencies is here

dginev commented 1 year ago

No real point in keeping this open I think.