Show More
@@ -0,0 +1,60 b'' | |||
|
1 | ((= Black&white ipython input/output style =)) | |
|
2 | ||
|
3 | ((*- extends 'latex_base.tplx' -*)) | |
|
4 | ||
|
5 | % Custom definitions | |
|
6 | ((* block definitions *)) | |
|
7 | ((( super() ))) | |
|
8 | ||
|
9 | % Pygments definitions | |
|
10 | ((( resources.latex.pygment_definitions ))) | |
|
11 | ||
|
12 | % % Exact colors from ipy | |
|
13 | % \definecolor{incolor}{rgb}{0.094, 0.698, 0.094} | |
|
14 | % \definecolor{lightincolor}{rgb}{0.329, 1.000, 0.329} | |
|
15 | % \definecolor{outcolor}{rgb}{0.698, 0.094, 0.094} | |
|
16 | % \definecolor{lightoutcolor}{rgb}{1.000, 0.329, 0.329} | |
|
17 | ||
|
18 | \definecolor{incolor}{rgb}{0.1, 0.5, 0.1} | |
|
19 | \definecolor{lightincolor}{rgb}{0.1, 0.7, 0.1} | |
|
20 | \definecolor{outcolor}{rgb}{0.5, 0.1, 0.1} | |
|
21 | \definecolor{lightoutcolor}{rgb}{0.7, 0.1, 0.1} | |
|
22 | ((* endblock definitions *)) | |
|
23 | ||
|
24 | %=============================================================================== | |
|
25 | % Input | |
|
26 | %=============================================================================== | |
|
27 | ||
|
28 | ((* block input scoped *)) | |
|
29 | ((( add_prompt(cell.input | highlight2latex(strip_verbatim=True), cell, 'In ', 'incolor') ))) | |
|
30 | ((* endblock input *)) | |
|
31 | ||
|
32 | ||
|
33 | %=============================================================================== | |
|
34 | % Output | |
|
35 | %=============================================================================== | |
|
36 | ||
|
37 | ((* block pyout scoped *)) | |
|
38 | ((*- for type in output | filter_data_type -*)) | |
|
39 | ((*- if type in ['text']*)) | |
|
40 | ((( add_prompt(output.text | escape_latex, cell, 'Out', 'outcolor') ))) | |
|
41 | ((* else -*)) | |
|
42 | \texttt{\color{outcolor}Out[{\color{lightoutcolor}((( cell.prompt_number )))}]:}((( super() ))) | |
|
43 | ((*- endif -*)) | |
|
44 | ((*- endfor -*)) | |
|
45 | ((* endblock pyout *)) | |
|
46 | ||
|
47 | ||
|
48 | %============================================================================== | |
|
49 | % Support Macros | |
|
50 | %============================================================================== | |
|
51 | ||
|
52 | % Name: draw_prompt | |
|
53 | % Purpose: Renders an output/input prompt | |
|
54 | ((* macro add_prompt(text, cell, prompt, prompt_color) -*)) | |
|
55 | ((*- set prompt_number = "" ~ cell.prompt_number -*)) | |
|
56 | ((*- set prompt_number_replacement = "." * (prompt_number | length + 2) -*)) | |
|
57 | \begin{Verbatim}[commandchars=\\\{\}] | |
|
58 | ((( text | add_prompts(first='{\color{' ~ prompt_color ~ '}' ~ prompt ~ '[{\\color{light' ~ prompt_color ~ '}' ~ prompt_number ~ '}]:} ', cont=' {\color{' ~ prompt_color ~ '}' ~ prompt_number_replacement ~ ':} ') ))) | |
|
59 | \end{Verbatim} | |
|
60 | ((*- endmacro *)) |
General Comments 0
You need to be logged in to leave comments.
Login now