diff --git a/IPython/nbconvert/templates/latex/notebook_style.tplx b/IPython/nbconvert/templates/latex/notebook_style.tplx index e7b91f5..2784301 100644 --- a/IPython/nbconvert/templates/latex/notebook_style.tplx +++ b/IPython/nbconvert/templates/latex/notebook_style.tplx @@ -20,6 +20,8 @@ ((( super() ))) \listfiles + % Pygments definitions + ((( resources.latex.pygment_definitions ))) \def\smaller{\fontsize{9.5pt}{9.5pt}\selectfont} @@ -65,14 +67,9 @@ ((* block input scoped *)) % Add contents below. - - \begin{ColorVerbatim} - \smaller{((( super() )))} - \end{ColorVerbatim} - % \begin{addmargin}[0.1\linewidth]{0em} % left, right - % \smaller{} - % \end{addmargin} +\smaller% +((( cell.input | highlight2latex )))% ((* endblock input *)) diff --git a/IPython/nbconvert/templates/latex/simple_style.tplx b/IPython/nbconvert/templates/latex/simple_style.tplx index a8ad797..8dfba95 100644 --- a/IPython/nbconvert/templates/latex/simple_style.tplx +++ b/IPython/nbconvert/templates/latex/simple_style.tplx @@ -6,13 +6,17 @@ % Custom packages ((* block packages *)) ((( super() ))) + \usepackage{needspace} % Make prompts follow contents ((* endblock packages *)) % Custom definitions ((* block definitions *)) ((( super() ))) - + + % Pygments definitions + ((( resources.latex.pygment_definitions ))) + \newlength{\promptspace} \setlength{\promptspace}{4\baselineskip} % Space needed to start a new % input/output @@ -30,6 +34,9 @@ \vspace{-2em} ((* endblock input_group -*)) +((* block input scoped *)) + ((( cell.input | highlight2latex ))) +((* endblock input *)) %=============================================================================== % Output