Show More
@@ -1,21 +1,17 b'' | |||||
1 |
|
1 | |||
2 | %=============================================================================== |
|
|||
3 | % Cell style |
|
|||
4 | %=============================================================================== |
|
|||
5 |
|
||||
6 | % Default to the simple output style |
|
2 | % Default to the simple output style | |
7 | ((* if not cell_style is defined *)) |
|
3 | ((* if not cell_style is defined *)) | |
8 | ((* set cell_style = 'notebook_style.tplx' *)) |
|
4 | ((* set cell_style = 'notebook_style.tplx' *)) | |
9 | ((* endif *)) |
|
5 | ((* endif *)) | |
10 |
|
6 | |||
11 | % Inherit from the specified cell style. |
|
7 | % Inherit from the specified cell style. | |
12 | ((* extends cell_style *)) |
|
8 | ((* extends cell_style *)) | |
13 |
|
9 | |||
14 |
|
10 | |||
15 | %=============================================================================== |
|
11 | %=============================================================================== | |
16 | % Latex Article |
|
12 | % Latex Article | |
17 | %=============================================================================== |
|
13 | %=============================================================================== | |
18 |
|
14 | |||
19 | ((* block docclass *)) |
|
15 | ((* block docclass *)) | |
20 | \documentclass{article} |
|
16 | \documentclass{article} | |
21 | ((* endblock docclass *)) No newline at end of file |
|
17 | ((* endblock docclass *)) |
@@ -1,33 +1,29 b'' | |||||
1 |
|
1 | |||
2 | %=============================================================================== |
|
|||
3 | % Cell style |
|
|||
4 | %=============================================================================== |
|
|||
5 |
|
||||
6 | % Default to the simple output style |
|
2 | % Default to the simple output style | |
7 | ((* if not cell_style is defined *)) |
|
3 | ((* if not cell_style is defined *)) | |
8 | ((* set cell_style = 'simple_style.tplx' *)) |
|
4 | ((* set cell_style = 'simple_style.tplx' *)) | |
9 | ((* endif *)) |
|
5 | ((* endif *)) | |
10 |
|
6 | |||
11 | % Inherit from the specified cell style. |
|
7 | % Inherit from the specified cell style. | |
12 | ((* extends cell_style *)) |
|
8 | ((* extends cell_style *)) | |
13 |
|
9 | |||
14 |
|
10 | |||
15 | %=============================================================================== |
|
11 | %=============================================================================== | |
16 | % Latex Book |
|
12 | % Latex Book | |
17 | %=============================================================================== |
|
13 | %=============================================================================== | |
18 |
|
14 | |||
19 | ((* block predoc *)) |
|
15 | ((* block predoc *)) | |
20 | ((( super() ))) |
|
16 | ((( super() ))) | |
21 | ((* block tableofcontents *))\tableofcontents((* endblock tableofcontents *)) |
|
17 | ((* block tableofcontents *))\tableofcontents((* endblock tableofcontents *)) | |
22 | ((* endblock predoc *)) |
|
18 | ((* endblock predoc *)) | |
23 |
|
19 | |||
24 | ((* block docclass *)) |
|
20 | ((* block docclass *)) | |
25 | \documentclass{book} |
|
21 | \documentclass{book} | |
26 | ((* endblock docclass *)) |
|
22 | ((* endblock docclass *)) | |
27 |
|
23 | |||
28 | ((* block h1 -*))\part((* endblock h1 -*)) |
|
24 | ((* block h1 -*))\part((* endblock h1 -*)) | |
29 | ((* block h2 -*))\chapter((* endblock h2 -*)) |
|
25 | ((* block h2 -*))\chapter((* endblock h2 -*)) | |
30 | ((* block h3 -*))\section((* endblock h3 -*)) |
|
26 | ((* block h3 -*))\section((* endblock h3 -*)) | |
31 | ((* block h4 -*))\subsection((* endblock h4 -*)) |
|
27 | ((* block h4 -*))\subsection((* endblock h4 -*)) | |
32 | ((* block h5 -*))\subsubsection((* endblock h5 -*)) |
|
28 | ((* block h5 -*))\subsubsection((* endblock h5 -*)) | |
33 | ((* block h6 -*))\paragraph((* endblock h6 -*)) No newline at end of file |
|
29 | ((* block h6 -*))\paragraph((* endblock h6 -*)) |
@@ -1,40 +1,34 b'' | |||||
1 |
|
||||
2 | %=============================================================================== |
|
|||
3 | % Cell style |
|
|||
4 | %=============================================================================== |
|
|||
5 |
|
||||
6 | % Inherit from the specified cell style. |
|
|||
7 | ((* extends 'latex_article.tplx' *)) |
|
1 | ((* extends 'latex_article.tplx' *)) | |
8 |
|
2 | |||
9 | %=============================================================================== |
|
3 | %=============================================================================== | |
10 | % Latex Sphinx Article |
|
4 | % Latex Sphinx Article | |
11 | %=============================================================================== |
|
5 | %=============================================================================== | |
12 |
|
6 | |||
13 | ((* block docclass *)) |
|
7 | ((* block docclass *)) | |
14 | % Make sure that the sphinx doc style knows who it inherits from. |
|
8 | % Make sure that the sphinx doc style knows who it inherits from. | |
15 | \def\sphinxdocclass{article} |
|
9 | \def\sphinxdocclass{article} | |
16 |
|
10 | |||
17 | % Declare the document class |
|
11 | % Declare the document class | |
18 | \documentclass[letterpaper,10pt,english]{((( resources.sphinx.texinputs | posix_path )))/sphinxhowto} |
|
12 | \documentclass[letterpaper,10pt,english]{((( resources.sphinx.texinputs | posix_path )))/sphinxhowto} | |
19 | ((* endblock docclass *)) |
|
13 | ((* endblock docclass *)) | |
20 |
|
14 | |||
21 | ((* block packages *)) |
|
15 | ((* block packages *)) | |
22 | ((* block chstyle *)) |
|
16 | ((* block chstyle *)) | |
23 | \usepackage[Bjarne]{((( resources.sphinx.texinputs | posix_path )))/fncychap} |
|
17 | \usepackage[Bjarne]{((( resources.sphinx.texinputs | posix_path )))/fncychap} | |
24 | ((* endblock chstyle *)) |
|
18 | ((* endblock chstyle *)) | |
25 |
|
19 | |||
26 | \usepackage{((( resources.sphinx.texinputs | posix_path )))/sphinx} |
|
20 | \usepackage{((( resources.sphinx.texinputs | posix_path )))/sphinx} | |
27 |
|
21 | |||
28 | ((( super() ))) |
|
22 | ((( super() ))) | |
29 | ((* endblock packages *)) |
|
23 | ((* endblock packages *)) | |
30 |
|
24 | |||
31 | ((* block commands *)) |
|
25 | ((* block commands *)) | |
32 | ((( super() ))) |
|
26 | ((( super() ))) | |
33 |
|
27 | |||
34 | % Override to specify your own logo |
|
28 | % Override to specify your own logo | |
35 | ((* block logo *))\newcommand{\sphinxlogo}{}((* endblock logo *)) |
|
29 | ((* block logo *))\newcommand{\sphinxlogo}{}((* endblock logo *)) | |
36 |
|
30 | |||
37 | % Make the index page of the document. |
|
31 | % Make the index page of the document. | |
38 | \makeindex |
|
32 | \makeindex | |
39 |
|
33 | |||
40 | ((* endblock commands *)) |
|
34 | ((* endblock commands *)) |
@@ -1,191 +1,190 b'' | |||||
1 | ((= Notebook input/output style =)) |
|
1 | ((= Notebook input/output style =)) | |
2 |
|
2 | |||
3 | ((* extends 'latex_base.tplx' *)) |
|
3 | ((* extends 'latex_base.tplx' *)) | |
4 |
|
4 | |||
5 | % Custom packages |
|
5 | % Custom packages | |
6 | ((* block packages *)) |
|
6 | ((* block packages *)) | |
7 | ((( super() ))) |
|
7 | ((( super() ))) | |
8 |
|
8 | |||
9 | \usepackage{tikz} % Needed to box output/input |
|
9 | \usepackage{tikz} % Needed to box output/input | |
10 | \usepackage{scrextend} % Used to indent output |
|
10 | \usepackage{scrextend} % Used to indent output | |
11 | \usepackage{needspace} % Make prompts follow contents |
|
11 | \usepackage{needspace} % Make prompts follow contents | |
12 | \usepackage{framed} % Used to draw output that spans multiple pages |
|
12 | \usepackage{framed} % Used to draw output that spans multiple pages | |
13 | ((* endblock packages *)) |
|
13 | ((* endblock packages *)) | |
14 |
|
14 | |||
15 | % Custom definitions |
|
15 | % Custom definitions | |
16 | ((* block definitions *)) |
|
16 | ((* block definitions *)) | |
17 | ((( super() ))) |
|
17 | ((( super() ))) | |
18 |
|
18 | |||
19 | % Pygments definitions |
|
19 | % Pygments definitions | |
20 | ((( resources.latex.pygment_definitions ))) |
|
20 | ((( resources.latex.pygment_definitions ))) | |
21 |
|
21 | |||
22 | % NB prompt colors |
|
22 | % NB prompt colors | |
23 | \definecolor{nbframe-border}{rgb}{0.867,0.867,0.867} |
|
23 | \definecolor{nbframe-border}{rgb}{0.867,0.867,0.867} | |
24 | \definecolor{nbframe-bg}{rgb}{0.969,0.969,0.969} |
|
24 | \definecolor{nbframe-bg}{rgb}{0.969,0.969,0.969} | |
25 | \definecolor{nbframe-in-prompt}{rgb}{0.0,0.0,0.502} |
|
25 | \definecolor{nbframe-in-prompt}{rgb}{0.0,0.0,0.502} | |
26 | \definecolor{nbframe-out-prompt}{rgb}{0.545,0.0,0.0} |
|
26 | \definecolor{nbframe-out-prompt}{rgb}{0.545,0.0,0.0} | |
27 |
|
27 | |||
28 | % NB prompt lengths |
|
28 | % NB prompt lengths | |
29 | \newlength{\inputpadding} |
|
29 | \newlength{\inputpadding} | |
30 | \setlength{\inputpadding}{0.5em} |
|
30 | \setlength{\inputpadding}{0.5em} | |
31 | \newlength{\cellleftmargin} |
|
31 | \newlength{\cellleftmargin} | |
32 | \setlength{\cellleftmargin}{0.15\linewidth} |
|
32 | \setlength{\cellleftmargin}{0.15\linewidth} | |
33 | \newlength{\borderthickness} |
|
33 | \newlength{\borderthickness} | |
34 | \setlength{\borderthickness}{0.4pt} |
|
34 | \setlength{\borderthickness}{0.4pt} | |
35 | \newlength{\smallerfontscale} |
|
35 | \newlength{\smallerfontscale} | |
36 | \setlength{\smallerfontscale}{9.5pt} |
|
36 | \setlength{\smallerfontscale}{9.5pt} | |
37 |
|
37 | |||
38 | % NB prompt font size |
|
38 | % NB prompt font size | |
39 | \def\smaller{\fontsize{\smallerfontscale}{\smallerfontscale}\selectfont} |
|
39 | \def\smaller{\fontsize{\smallerfontscale}{\smallerfontscale}\selectfont} | |
40 |
|
40 | |||
41 | % Define a background layer, in which the nb prompt shape is drawn |
|
41 | % Define a background layer, in which the nb prompt shape is drawn | |
42 | \pgfdeclarelayer{background} |
|
42 | \pgfdeclarelayer{background} | |
43 | \pgfsetlayers{background,main} |
|
43 | \pgfsetlayers{background,main} | |
44 | \usetikzlibrary{calc} |
|
44 | \usetikzlibrary{calc} | |
45 |
|
45 | |||
46 | % define styles for the normal border and the torn border |
|
46 | % define styles for the normal border and the torn border | |
47 | \tikzset{ |
|
47 | \tikzset{ | |
48 | normal border/.style={draw=nbframe-border, fill=nbframe-bg, |
|
48 | normal border/.style={draw=nbframe-border, fill=nbframe-bg, | |
49 | rectangle, rounded corners=2.5pt, line width=\borderthickness}, |
|
49 | rectangle, rounded corners=2.5pt, line width=\borderthickness}, | |
50 | torn border/.style={draw=white, fill=white, line width=\borderthickness}} |
|
50 | torn border/.style={draw=white, fill=white, line width=\borderthickness}} | |
51 |
|
51 | |||
52 | % Macro to draw the shape behind the text, when it fits completly in the |
|
52 | % Macro to draw the shape behind the text, when it fits completly in the | |
53 | % page |
|
53 | % page | |
54 | \def\notebookcellframe#1{% |
|
54 | \def\notebookcellframe#1{% | |
55 | \tikz{% |
|
55 | \tikz{% | |
56 | \node[inner sep=\inputpadding] (A) {#1};% Draw the text of the node |
|
56 | \node[inner sep=\inputpadding] (A) {#1};% Draw the text of the node | |
57 | \begin{pgfonlayer}{background}% Draw the shape behind |
|
57 | \begin{pgfonlayer}{background}% Draw the shape behind | |
58 | \fill[normal border]% |
|
58 | \fill[normal border]% | |
59 | (A.south east) -- ($(A.south west)+(\cellleftmargin,0)$) -- |
|
59 | (A.south east) -- ($(A.south west)+(\cellleftmargin,0)$) -- | |
60 | ($(A.north west)+(\cellleftmargin,0)$) -- (A.north east) -- cycle; |
|
60 | ($(A.north west)+(\cellleftmargin,0)$) -- (A.north east) -- cycle; | |
61 | \end{pgfonlayer}}}% |
|
61 | \end{pgfonlayer}}}% | |
62 |
|
62 | |||
63 | % Macro to draw the shape, when the text will continue in next page |
|
63 | % Macro to draw the shape, when the text will continue in next page | |
64 | \def\notebookcellframetop#1{% |
|
64 | \def\notebookcellframetop#1{% | |
65 | \tikz{% |
|
65 | \tikz{% | |
66 | \node[inner sep=\inputpadding] (A) {#1}; % Draw the text of the node |
|
66 | \node[inner sep=\inputpadding] (A) {#1}; % Draw the text of the node | |
67 | \begin{pgfonlayer}{background} |
|
67 | \begin{pgfonlayer}{background} | |
68 | \fill[normal border] % Draw the ``complete shape'' behind |
|
68 | \fill[normal border] % Draw the ``complete shape'' behind | |
69 | (A.south east) -- ($(A.south west)+(\cellleftmargin,0)$) -- |
|
69 | (A.south east) -- ($(A.south west)+(\cellleftmargin,0)$) -- | |
70 | ($(A.north west)+(\cellleftmargin,0)$) -- (A.north east) -- cycle; |
|
70 | ($(A.north west)+(\cellleftmargin,0)$) -- (A.north east) -- cycle; | |
71 | \fill[torn border] % Add the torn lower border |
|
71 | \fill[torn border] % Add the torn lower border | |
72 | ($(A.south east)-(0,.1)$) -- ($(A.south west)+(\cellleftmargin,-.1)$) -- |
|
72 | ($(A.south east)-(0,.1)$) -- ($(A.south west)+(\cellleftmargin,-.1)$) -- | |
73 | ($(A.south west)+(\cellleftmargin,.1)$) -- ($(A.south east)+(0,.1)$) -- cycle; |
|
73 | ($(A.south west)+(\cellleftmargin,.1)$) -- ($(A.south east)+(0,.1)$) -- cycle; | |
74 | \end{pgfonlayer}}} |
|
74 | \end{pgfonlayer}}} | |
75 |
|
75 | |||
76 | % Macro to draw the shape, when the text continues from previous page |
|
76 | % Macro to draw the shape, when the text continues from previous page | |
77 | \def\notebookcellframebottom#1{% |
|
77 | \def\notebookcellframebottom#1{% | |
78 | \tikz{% |
|
78 | \tikz{% | |
79 | \node[inner sep=\inputpadding] (A) {#1}; % Draw the text of the node |
|
79 | \node[inner sep=\inputpadding] (A) {#1}; % Draw the text of the node | |
80 | \begin{pgfonlayer}{background} |
|
80 | \begin{pgfonlayer}{background} | |
81 | \fill[normal border] % Draw the ``complete shape'' behind |
|
81 | \fill[normal border] % Draw the ``complete shape'' behind | |
82 | (A.south east) -- ($(A.south west)+(\cellleftmargin,0)$) -- |
|
82 | (A.south east) -- ($(A.south west)+(\cellleftmargin,0)$) -- | |
83 | ($(A.north west)+(\cellleftmargin,0)$) -- (A.north east) -- cycle; |
|
83 | ($(A.north west)+(\cellleftmargin,0)$) -- (A.north east) -- cycle; | |
84 | \fill[torn border] % Add the torn upper border |
|
84 | \fill[torn border] % Add the torn upper border | |
85 | ($(A.north east)-(0,.1)$) -- ($(A.north west)+(\cellleftmargin,-.1)$) -- |
|
85 | ($(A.north east)-(0,.1)$) -- ($(A.north west)+(\cellleftmargin,-.1)$) -- | |
86 | ($(A.north west)+(\cellleftmargin,.1)$) -- ($(A.north east)+(0,.1)$) -- cycle; |
|
86 | ($(A.north west)+(\cellleftmargin,.1)$) -- ($(A.north east)+(0,.1)$) -- cycle; | |
87 | \end{pgfonlayer}}} |
|
87 | \end{pgfonlayer}}} | |
88 |
|
88 | |||
89 | % Macro to draw the shape, when both the text continues from previous page |
|
89 | % Macro to draw the shape, when both the text continues from previous page | |
90 | % and it will continue in next page |
|
90 | % and it will continue in next page | |
91 | \def\notebookcellframemiddle#1{% |
|
91 | \def\notebookcellframemiddle#1{% | |
92 | \tikz{% |
|
92 | \tikz{% | |
93 | \node[inner sep=\inputpadding] (A) {#1}; % Draw the text of the node |
|
93 | \node[inner sep=\inputpadding] (A) {#1}; % Draw the text of the node | |
94 | \begin{pgfonlayer}{background} |
|
94 | \begin{pgfonlayer}{background} | |
95 | \fill[normal border] % Draw the ``complete shape'' behind |
|
95 | \fill[normal border] % Draw the ``complete shape'' behind | |
96 | (A.south east) -- ($(A.south west)+(\cellleftmargin,0)$) -- |
|
96 | (A.south east) -- ($(A.south west)+(\cellleftmargin,0)$) -- | |
97 | ($(A.north west)+(\cellleftmargin,0)$) -- (A.north east) -- cycle; |
|
97 | ($(A.north west)+(\cellleftmargin,0)$) -- (A.north east) -- cycle; | |
98 | \fill[torn border] % Add the torn lower border |
|
98 | \fill[torn border] % Add the torn lower border | |
99 | ($(A.south east)-(0,.1)$) -- ($(A.south west)+(\cellleftmargin,-.1)$) -- |
|
99 | ($(A.south east)-(0,.1)$) -- ($(A.south west)+(\cellleftmargin,-.1)$) -- | |
100 | ($(A.south west)+(\cellleftmargin,.1)$) -- ($(A.south east)+(0,.1)$) -- cycle; |
|
100 | ($(A.south west)+(\cellleftmargin,.1)$) -- ($(A.south east)+(0,.1)$) -- cycle; | |
101 | \fill[torn border] % Add the torn upper border |
|
101 | \fill[torn border] % Add the torn upper border | |
102 | ($(A.north east)-(0,.1)$) -- ($(A.north west)+(\cellleftmargin,-.1)$) -- |
|
102 | ($(A.north east)-(0,.1)$) -- ($(A.north west)+(\cellleftmargin,-.1)$) -- | |
103 | ($(A.north west)+(\cellleftmargin,.1)$) -- ($(A.north east)+(0,.1)$) -- cycle; |
|
103 | ($(A.north west)+(\cellleftmargin,.1)$) -- ($(A.north east)+(0,.1)$) -- cycle; | |
104 | \end{pgfonlayer}}} |
|
104 | \end{pgfonlayer}}} | |
105 |
|
105 | |||
106 | % Define the environment which puts the frame |
|
106 | % Define the environment which puts the frame | |
107 | % In this case, the environment also accepts an argument with an optional |
|
107 | % In this case, the environment also accepts an argument with an optional | |
108 | % title (which defaults to ``Example'', which is typeset in a box overlaid |
|
108 | % title (which defaults to ``Example'', which is typeset in a box overlaid | |
109 | % on the top border |
|
109 | % on the top border | |
110 | \newenvironment{notebookcell}[1][0]{% |
|
110 | \newenvironment{notebookcell}[1][0]{% | |
111 | \def\FrameCommand{\notebookcellframe}% |
|
111 | \def\FrameCommand{\notebookcellframe}% | |
112 | \def\FirstFrameCommand{\notebookcellframetop}% |
|
112 | \def\FirstFrameCommand{\notebookcellframetop}% | |
113 | \def\LastFrameCommand{\notebookcellframebottom}% |
|
113 | \def\LastFrameCommand{\notebookcellframebottom}% | |
114 | \def\MidFrameCommand{\notebookcellframemiddle}% |
|
114 | \def\MidFrameCommand{\notebookcellframemiddle}% | |
115 | \par\vspace{1\baselineskip}% |
|
115 | \par\vspace{1\baselineskip}% | |
116 | \MakeFramed {\FrameRestore}% |
|
116 | \MakeFramed {\FrameRestore}% | |
117 | \noindent\tikz\node[inner sep=0em] at ($(A.north west)-(0,0)$) {% |
|
117 | \noindent\tikz\node[inner sep=0em] at ($(A.north west)-(0,0)$) {% | |
118 | ((( draw_prompt("In", "#1", "nbframe-in-prompt", "2pt") )))% |
|
118 | ((( draw_prompt("In", "#1", "nbframe-in-prompt", "2pt") )))% | |
119 | }; \par}% |
|
119 | }; \par}% | |
120 | {\endMakeFramed} |
|
120 | {\endMakeFramed} | |
121 |
|
121 | |||
122 | ((* endblock definitions *)) |
|
122 | ((* endblock definitions *)) | |
123 |
|
123 | |||
124 |
|
||||
125 | %=============================================================================== |
|
124 | %=============================================================================== | |
126 | % Input |
|
125 | % Input | |
127 | %=============================================================================== |
|
126 | %=============================================================================== | |
128 |
|
127 | |||
129 | ((* block input scoped *)) |
|
128 | ((* block input scoped *)) | |
130 | % Add contents below. |
|
129 | % Add contents below. | |
131 |
|
130 | |||
132 | {\par% |
|
131 | {\par% | |
133 | \vspace{-1\baselineskip}% |
|
132 | \vspace{-1\baselineskip}% | |
134 | \needspace{4\baselineskip}}% |
|
133 | \needspace{4\baselineskip}}% | |
135 | \begin{notebookcell}[((( cell.prompt_number )))]% |
|
134 | \begin{notebookcell}[((( cell.prompt_number )))]% | |
136 | \begin{addmargin}[\cellleftmargin]{0em}% left, right |
|
135 | \begin{addmargin}[\cellleftmargin]{0em}% left, right | |
137 | {\smaller% |
|
136 | {\smaller% | |
138 | \par% |
|
137 | \par% | |
139 | ((* block extra_input_spacing *))((* endblock extra_input_spacing *))% |
|
138 | ((* block extra_input_spacing *))((* endblock extra_input_spacing *))% | |
140 | \vspace{-1\smallerfontscale}% |
|
139 | \vspace{-1\smallerfontscale}% | |
141 | ((( cell.input | highlight2latex )))% |
|
140 | ((( cell.input | highlight2latex )))% | |
142 | \par% |
|
141 | \par% | |
143 | \vspace{-1\smallerfontscale}}% |
|
142 | \vspace{-1\smallerfontscale}}% | |
144 | \end{addmargin} |
|
143 | \end{addmargin} | |
145 | \end{notebookcell} |
|
144 | \end{notebookcell} | |
146 |
|
145 | |||
147 | ((* endblock input *)) |
|
146 | ((* endblock input *)) | |
148 |
|
147 | |||
149 | %=============================================================================== |
|
148 | %=============================================================================== | |
150 | % Output |
|
149 | % Output | |
151 | %=============================================================================== |
|
150 | %=============================================================================== | |
152 |
|
151 | |||
153 | ((* block output -*)) |
|
152 | ((* block output -*)) | |
154 | \par\vspace{1\smallerfontscale}% |
|
153 | \par\vspace{1\smallerfontscale}% | |
155 | % Only render the prompt if the cell is pyout. Note, the outputs prompt |
|
154 | % Only render the prompt if the cell is pyout. Note, the outputs prompt | |
156 | % block isn't used since we need to check each indiviual output and only |
|
155 | % block isn't used since we need to check each indiviual output and only | |
157 | % add prompts to the pyout ones. |
|
156 | % add prompts to the pyout ones. | |
158 | ((* if output.output_type in ['pyout'] *)) |
|
157 | ((* if output.output_type in ['pyout'] *)) | |
159 | {\par% |
|
158 | {\par% | |
160 | \vspace{-1\smallerfontscale}% |
|
159 | \vspace{-1\smallerfontscale}% | |
161 | \noindent% |
|
160 | \noindent% | |
162 | ((( draw_prompt("Out", cell.prompt_number, "nbframe-out-prompt", "0em") )))% |
|
161 | ((( draw_prompt("Out", cell.prompt_number, "nbframe-out-prompt", "0em") )))% | |
163 | ((* block extra_output_spacing *))((* endblock extra_output_spacing *))}% |
|
162 | ((* block extra_output_spacing *))((* endblock extra_output_spacing *))}% | |
164 | ((* endif *))% |
|
163 | ((* endif *))% | |
165 | % |
|
164 | % | |
166 | \begin{addmargin}[\cellleftmargin]{0em}% left, right |
|
165 | \begin{addmargin}[\cellleftmargin]{0em}% left, right | |
167 | {\smaller% |
|
166 | {\smaller% | |
168 | \vspace{-1\smallerfontscale}% |
|
167 | \vspace{-1\smallerfontscale}% | |
169 | ((( super() )))}% |
|
168 | ((( super() )))}% | |
170 | \end{addmargin}% |
|
169 | \end{addmargin}% | |
171 | ((*- endblock output *)) |
|
170 | ((*- endblock output *)) | |
172 |
|
171 | |||
173 | %============================================================================== |
|
172 | %============================================================================== | |
174 | % Support Macros |
|
173 | % Support Macros | |
175 | %============================================================================== |
|
174 | %============================================================================== | |
176 |
|
175 | |||
177 | % Name: draw_prompt |
|
176 | % Name: draw_prompt | |
178 | % Purpose: Renders an output/input prompt for notebook style pdfs |
|
177 | % Purpose: Renders an output/input prompt for notebook style pdfs | |
179 | ((* macro draw_prompt(prompt, number, color, space) -*)) |
|
178 | ((* macro draw_prompt(prompt, number, color, space) -*)) | |
180 | \begin{minipage}{\cellleftmargin}% |
|
179 | \begin{minipage}{\cellleftmargin}% | |
181 | \hfill% |
|
180 | \hfill% | |
182 | {\smaller% |
|
181 | {\smaller% | |
183 | \tt% |
|
182 | \tt% | |
184 | \color{(((color)))}% |
|
183 | \color{(((color)))}% | |
185 | (((prompt)))[(((number)))]:}% |
|
184 | (((prompt)))[(((number)))]:}% | |
186 | \hspace{\inputpadding}% |
|
185 | \hspace{\inputpadding}% | |
187 | \hspace{(((space)))}% |
|
186 | \hspace{(((space)))}% | |
188 | \hspace{3pt}% |
|
187 | \hspace{3pt}% | |
189 | \end{minipage}% |
|
188 | \end{minipage}% | |
190 | ((*- endmacro *)) |
|
189 | ((*- endmacro *)) | |
191 |
|
190 |
@@ -1,68 +1,67 b'' | |||||
1 | ((= Simple input/output style =)) |
|
1 | ((= Simple input/output style =)) | |
2 |
|
2 | |||
3 | ((*- extends 'latex_base.tplx' -*)) |
|
3 | ((*- extends 'latex_base.tplx' -*)) | |
4 |
|
4 | |||
5 |
|
||||
6 | % Custom packages |
|
5 | % Custom packages | |
7 | ((* block packages *)) |
|
6 | ((* block packages *)) | |
8 | ((( super() ))) |
|
7 | ((( super() ))) | |
9 |
|
8 | |||
10 | \usepackage{needspace} % Make prompts follow contents |
|
9 | \usepackage{needspace} % Make prompts follow contents | |
11 | ((* endblock packages *)) |
|
10 | ((* endblock packages *)) | |
12 |
|
11 | |||
13 | % Custom definitions |
|
12 | % Custom definitions | |
14 | ((* block definitions *)) |
|
13 | ((* block definitions *)) | |
15 | ((( super() ))) |
|
14 | ((( super() ))) | |
16 |
|
15 | |||
17 | % Pygments definitions |
|
16 | % Pygments definitions | |
18 | ((( resources.latex.pygment_definitions ))) |
|
17 | ((( resources.latex.pygment_definitions ))) | |
19 |
|
18 | |||
20 | \newlength{\promptspace} |
|
19 | \newlength{\promptspace} | |
21 | \setlength{\promptspace}{4\baselineskip} % Space needed to start a new |
|
20 | \setlength{\promptspace}{4\baselineskip} % Space needed to start a new | |
22 | % input/output |
|
21 | % input/output | |
23 | ((* endblock definitions *)) |
|
22 | ((* endblock definitions *)) | |
24 | %=============================================================================== |
|
23 | %=============================================================================== | |
25 | % Input |
|
24 | % Input | |
26 | %=============================================================================== |
|
25 | %=============================================================================== | |
27 |
|
26 | |||
28 | ((*- block in_prompt scoped -*)) |
|
27 | ((*- block in_prompt scoped -*)) | |
29 | ((( draw_prompt('Input') ))) |
|
28 | ((( draw_prompt('Input') ))) | |
30 | ((*- endblock in_prompt -*)) |
|
29 | ((*- endblock in_prompt -*)) | |
31 |
|
30 | |||
32 | ((*- block input_group scoped -*)) |
|
31 | ((*- block input_group scoped -*)) | |
33 | (((- super() ))) |
|
32 | (((- super() ))) | |
34 | \vspace{-2em} |
|
33 | \vspace{-2em} | |
35 | ((* endblock input_group -*)) |
|
34 | ((* endblock input_group -*)) | |
36 |
|
35 | |||
37 | ((* block input scoped *)) |
|
36 | ((* block input scoped *)) | |
38 | ((( cell.input | highlight2latex ))) |
|
37 | ((( cell.input | highlight2latex ))) | |
39 | ((* endblock input *)) |
|
38 | ((* endblock input *)) | |
40 |
|
39 | |||
41 | %=============================================================================== |
|
40 | %=============================================================================== | |
42 | % Output |
|
41 | % Output | |
43 | %=============================================================================== |
|
42 | %=============================================================================== | |
44 |
|
43 | |||
45 | ((*- block output_prompt scoped -*)) |
|
44 | ((*- block output_prompt scoped -*)) | |
46 | ((( draw_prompt('Output') ))) |
|
45 | ((( draw_prompt('Output') ))) | |
47 | ((*- endblock output_prompt -*)) |
|
46 | ((*- endblock output_prompt -*)) | |
48 |
|
47 | |||
49 | ((*- block output_group scoped -*)) |
|
48 | ((*- block output_group scoped -*)) | |
50 | (((- super() ))) |
|
49 | (((- super() ))) | |
51 | \vspace{-2em} |
|
50 | \vspace{-2em} | |
52 | ((* endblock output_group -*)) |
|
51 | ((* endblock output_group -*)) | |
53 |
|
52 | |||
54 | %============================================================================== |
|
53 | %============================================================================== | |
55 | % Support Macros |
|
54 | % Support Macros | |
56 | %============================================================================== |
|
55 | %============================================================================== | |
57 |
|
56 | |||
58 | % Name: draw_prompt |
|
57 | % Name: draw_prompt | |
59 | % Purpose: Renders an output/input prompt for notebook style pdfs |
|
58 | % Purpose: Renders an output/input prompt for notebook style pdfs | |
60 | ((* macro draw_prompt(prompt) *)) |
|
59 | ((* macro draw_prompt(prompt) *)) | |
61 | % Add a horizantal break, along with break title. |
|
60 | % Add a horizantal break, along with break title. | |
62 | \needspace{\promptspace} |
|
61 | \needspace{\promptspace} | |
63 | \br\br |
|
62 | \br\br | |
64 | {\scriptsize ((( prompt )))} |
|
63 | {\scriptsize ((( prompt )))} | |
65 | \br |
|
64 | \br | |
66 | \rule[10pt]{\linewidth}{0.5pt} |
|
65 | \rule[10pt]{\linewidth}{0.5pt} | |
67 | \vspace{-2.5em} |
|
66 | \vspace{-2.5em} | |
68 | ((* endmacro *)) |
|
67 | ((* endmacro *)) |
General Comments 0
You need to be logged in to leave comments.
Login now