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