nbautoexport icon indicating copy to clipboard operation
nbautoexport copied to clipboard

Install LaTeX in CI to enable testing PDF export format

Open jayqi opened this issue 4 years ago • 2 comments

nbconvert requires a LaTeX engine to convert to pdf. We need to figure out the best way to install this in our CI pipeline so we can test the pdf export format in our unit tests.

Some strategies and notes about them:

  • [ ] Install standard TeX distributions per operating system (TeX Live, MacTeX, MikTeX).
    • Will require different conditional pipeline steps, which adds complexity to the pipeline. Example of install scripts from LightGBM: ubuntu, macos, windows 1, 2, 3
  • [ ] Install texlive-core from conda-forge.
    • [X] Out of box: does not work. nbconvert uses xelatex but this installation only has pdflatex.
    • [ ] Hack it by symlinking xelatex to pdflatex
    • [ ] Set nbconvert configuration to use pdflatex instead of xelatex
  • [ ] Install tectonic, a different TeX distribution that's available cross-platform from conda-forge
    • [X] Out of box: does not work. This gives a CLI program named tectonic
    • [X] Hack it by symlinking xelatex to tectonic: Does not work. nbconvert passes a --quiet flag that tectonic does not support.
    • [ ] Set nbconvert configuration to use tectonic instead of xelatex (and with appropriate CLI flags)
  • [ ] Install tinytex. Has install scripts for different OSes. Will need different conditional pipeline steps, which adds complexity to the pipeline, but scripts hopefully work out of the box.

jayqi avatar Jul 02 '20 17:07 jayqi

TinyTeX actually worked and seems like the way to go. There is an implementation here: https://github.com/drivendataorg/nbautoexport/pull/41

Unfortunately, there is a bug with nbconvert in Windows that causes the PDF generation to fail. https://github.com/jupyter/nbconvert/issues/974

jayqi avatar Jul 26 '20 01:07 jayqi

The Windows xelatex bug was fixed and the change was part of the nbconvert v6.0.0 release.

jayqi avatar Sep 18 '20 03:09 jayqi