diff --git a/IPython/nbconvert/preprocessors/latex.py b/IPython/nbconvert/preprocessors/latex.py index cb40048..ddbd9d2 100755 --- a/IPython/nbconvert/preprocessors/latex.py +++ b/IPython/nbconvert/preprocessors/latex.py @@ -44,7 +44,8 @@ class LatexPreprocessor(Preprocessor): preprocessors to pass variables into the Jinja engine. """ # Generate Pygments definitions for Latex - resources["pygment_definitions"] = LatexFormatter().get_style_defs() + resources["latex"] = {} + resources["latex"]["pygment_definitions"] = LatexFormatter().get_style_defs() return super(LatexPreprocessor, self).preprocess(nb, resources) diff --git a/IPython/nbconvert/templates/latex/latex_base.tplx b/IPython/nbconvert/templates/latex/latex_base.tplx index c095317..d4a8a80 100644 --- a/IPython/nbconvert/templates/latex/latex_base.tplx +++ b/IPython/nbconvert/templates/latex/latex_base.tplx @@ -27,6 +27,9 @@ This template does not define a docclass, the inheriting class must define this. % internal navigation ('pdf bookmarks' for the table of contents, % internal cross-reference links, web links for URLs, etc.) \usepackage{hyperref} + + % Pygments definitions + ((( resources.latex.pygment_definitions ))) ((* endblock packages *)) ((* block definitions *))