##// END OF EJS Templates
Added black and white ipython style
Jonathan Frederic -
Show More
@@ -0,0 +1,39 b''
1 ((= Black&white ipython input/output style =))
2
3 ((*- extends 'latex_base.tplx' -*))
4
5 %===============================================================================
6 % Input
7 %===============================================================================
8
9 ((* block input scoped *))
10 \begin{verbatim}((( add_prompt(cell.input, cell, 'In ') )))\end{verbatim}
11 ((* endblock input *))
12
13
14 %===============================================================================
15 % Output
16 %===============================================================================
17
18 ((* block pyout scoped *))
19 ((*- for type in output | filter_data_type -*))
20 ((*- if type in ['text']*))
21 \begin{verbatim}((( add_prompt(output.text, cell, 'Out') )))\end{verbatim}
22 ((*- else -*))
23 \verb+Out[((( cell.prompt_number )))]:+((( super() )))
24 ((*- endif -*))
25 ((*- endfor -*))
26 ((* endblock pyout *))
27
28
29 %==============================================================================
30 % Support Macros
31 %==============================================================================
32
33 % Name: draw_prompt
34 % Purpose: Renders an output/input prompt
35 ((* macro add_prompt(text, cell, prompt) -*))
36 ((*- set prompt_number = "" ~ cell.prompt_number -*))
37 ((*- set prompt_number_replacement = "." * (prompt_number | length + 2) -*))
38 (((- text | add_prompts(first=prompt ~ '[' ~ prompt_number ~ ']: ', cont=' ' ~ prompt_number_replacement ~ ': ') -)))
39 ((*- endmacro *))
General Comments 0
You need to be logged in to leave comments. Login now