From 8ecadda427e63b2f17c060874d90e8a81d994bf9 2014-10-15 19:12:07 From: Jessica B. Hamrick Date: 2014-10-15 19:12:07 Subject: [PATCH] Display prompt numbers correctly in latex output --- diff --git a/IPython/nbconvert/templates/latex/style_bw_ipython.tplx b/IPython/nbconvert/templates/latex/style_bw_ipython.tplx index 84859ab..256873c 100644 --- a/IPython/nbconvert/templates/latex/style_bw_ipython.tplx +++ b/IPython/nbconvert/templates/latex/style_bw_ipython.tplx @@ -33,7 +33,7 @@ % Name: draw_prompt % Purpose: Renders an output/input prompt ((* macro add_prompt(text, cell, prompt) -*)) - ((*- set prompt_number = "" ~ cell.prompt_number -*)) + ((*- set prompt_number = "" ~ (cell.prompt_number | replace(None, " ")) -*)) ((*- set indentation = " " * (prompt_number | length + 7) -*)) \begin{verbatim} (((- text | add_prompts(first=prompt ~ '[' ~ prompt_number ~ ']: ', cont=indentation) -))) diff --git a/IPython/nbconvert/templates/latex/style_ipython.tplx b/IPython/nbconvert/templates/latex/style_ipython.tplx index 7799d18..c89abbb 100644 --- a/IPython/nbconvert/templates/latex/style_ipython.tplx +++ b/IPython/nbconvert/templates/latex/style_ipython.tplx @@ -46,7 +46,7 @@ % Name: draw_prompt % Purpose: Renders an output/input prompt ((* macro add_prompt(text, cell, prompt, prompt_color) -*)) - ((*- set prompt_number = "" ~ cell.prompt_number -*)) + ((*- set prompt_number = "" ~ (cell.prompt_number | replace(None, " ")) -*)) ((*- set indention = " " * (prompt_number | length + 7) -*)) \begin{Verbatim}[commandchars=\\\{\}] ((( text | add_prompts(first='{\color{' ~ prompt_color ~ '}' ~ prompt ~ '[{\\color{' ~ prompt_color ~ '}' ~ prompt_number ~ '}]:} ', cont=indention) )))