'Jinja2 templates for latex - tutorials

I was wondering if someone can point me to the tutorials on how to create custom Jinja2 templates for LaTeX, so that I can use it in with nbconvert to convert Jupyter notebook into LaTeX?



Solution 1:[1]

Unfortunately that is highly undocumented. I would suggest asking on the mailing list or directly open an issue on GitHub (jupyter/nbconvert repo)

The normal template informations you find will work with one difference that you need to replace the template extension from .tpl to .tplxand replace the jinja delimiters: {% to ((* for blocks , {{ to ((( for variable interpolations and {# to ((= for comments + all the symetric closing markers. The reasoning is that latex uses { heavily and you want to avoid conflict.

Otherwise there is close to no difference between latex and non-latex templates.

Solution 2:[2]

I found this tutorial from the IPython/Jupyter Workshop at the NGCM Summer Academy (official jupyter github).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Matt
Solution 2 James Hirschorn