Friday, June 10, 2016

Anaconda2 jupyter notebook fix to export to pdf

Under Linux Mint, the problem arises when issuing:
 $ ~/anaconda2/bin/jupyter nbconvert my_notebook.ipynb --to pdf
During the conversion, LaTeX fails with the error:
! LaTeX Error: File `ulem.sty' not found.
This is solved by installing the texlive-generic-recommended package:
 $ sudo apt-get install texlive-generic-recommended

Get mathjax equations rendered under wkhtmltopdf

Trick source

Try using --javascript-delay [ms]. [ms] is the time in milliseconds wkhtmltopdf waits for complex scripts to finish. --javascript-delay 25000 is a good value to get the job done