Grimoire

LaTeX and JupyterHub

Generating out­puts lo­cally

Published:
This is part of the jupyter stuff col­lec­tion.

LaTeX pack­ages

Recently I shifted to us­ing tlmgr to man­age my tex in­stal­la­tion. The ra­tio­nale be­hind my de­ci­sion is­n’t rel­e­vant to this post, how­ever, for get­ting a pdf out­put some of the pack­ages I needed are listed for ease of re-in­stal­la­tion:

sudo tlmgr install environ tcolorbox trimspaces adjustbox collectbox ucs titling

This ac­tu­ally high­lights a caveat of the sys­tem, that is that the list of re­quired pack­ages is not out­putted in one go, and in­stead every time a de­pen­dency is in­stalled a new er­ror will only be re­ported when the ex­port process is run again. Do note, how­ever, that this is a lim­i­ta­tion of LaTeX it­self and is­n’t re­ally JupyterHubs fault.

An is­sue with us­ing the reg­u­lar print di­a­log, is that the math­jax ren­der is not part of the out­put doc­u­ment, mak­ing it es­sen­tially use­less.

Eventually to deal with the an­noy­ance of re-runs it is ac­tu­ally a lot more vi­able to ex­port as a .tex file and then use an au­to­mated tool for grab­bing the de­pen­den­cies. I per­son­ally of­ten use texliveon­fly. So that works out to:

sudo tlmgr install texliveonfly
texliveonfly whatever.tex
# After this you can export via JupyterHub

Honestly, it is best to ac­tu­ally ex­port the .tex and process that. When run­ning lo­cally at any rate, it’s al­most al­ways more an­noy­ing to work with the browser in­ter­face.