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