##// END OF EJS Templates
Added black and white ipython style
Added black and white ipython style

File last commit:

r12711:430cce14
r12711:430cce14
Show More
bw_ipython_style.tplx
39 lines | 1.4 KiB | text/plain | TextLexer
((= 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 *))