diff --git a/IPython/nbconvert/templates/latex/bw_ipython_style.tplx b/IPython/nbconvert/templates/latex/bw_ipython_style.tplx new file mode 100644 index 0000000..1d77964 --- /dev/null +++ b/IPython/nbconvert/templates/latex/bw_ipython_style.tplx @@ -0,0 +1,39 @@ +((= Black&white ipython input/output style =)) + +((*- extends 'latex_base.tplx' -*)) + +%=============================================================================== +% Input +%=============================================================================== + +((* block input scoped *)) + \begin{verbatim}((( add_prompt(cell.input, cell, 'In ') )))\end{verbatim} +((* endblock input *)) + + +%=============================================================================== +% Output +%=============================================================================== + +((* block pyout scoped *)) + ((*- for type in output | filter_data_type -*)) + ((*- if type in ['text']*)) + \begin{verbatim}((( add_prompt(output.text, cell, 'Out') )))\end{verbatim} + ((*- else -*)) + \verb+Out[((( cell.prompt_number )))]:+((( super() ))) + ((*- endif -*)) + ((*- endfor -*)) +((* endblock pyout *)) + + +%============================================================================== +% Support Macros +%============================================================================== + +% Name: draw_prompt +% Purpose: Renders an output/input prompt +((* macro add_prompt(text, cell, prompt) -*)) + ((*- set prompt_number = "" ~ cell.prompt_number -*)) + ((*- set prompt_number_replacement = "." * (prompt_number | length + 2) -*)) + (((- text | add_prompts(first=prompt ~ '[' ~ prompt_number ~ ']: ', cont=' ' ~ prompt_number_replacement ~ ': ') -))) +((*- endmacro *))