Show More
@@ -91,6 +91,7 b' Note: For best display, use latex syntax highlighting. =))' | |||||
91 | ((* if resources.sphinx.outputstyle == 'notebook' *)) |
|
91 | ((* if resources.sphinx.outputstyle == 'notebook' *)) | |
92 | \definecolor{nbframe-border}{rgb}{0.8,0.8,0.8} |
|
92 | \definecolor{nbframe-border}{rgb}{0.8,0.8,0.8} | |
93 | \definecolor{nbframe-bg}{rgb}{0.95,0.95,0.95} |
|
93 | \definecolor{nbframe-bg}{rgb}{0.95,0.95,0.95} | |
|
94 | \definecolor{nbframe-prompt}{rgb}{0.05,0.05,0.3} | |||
94 |
|
95 | |||
95 | \newenvironment{ColorVerbatim} |
|
96 | \newenvironment{ColorVerbatim} | |
96 |
{\begin{mdframed}[backgroundcolor=nbframe-bg, |
|
97 | {\begin{mdframed}[backgroundcolor=nbframe-bg, userdefinedwidth=1\linewidth, leftmargin=0.08\linewidth, linecolor=nbframe-border, linewidth=1pt, usetwoside=false]} | |
@@ -132,7 +133,10 b' Note: For best display, use latex syntax highlighting. =))' | |||||
132 | % Start of the document |
|
133 | % Start of the document | |
133 | \begin{document} |
|
134 | \begin{document} | |
134 | \maketitle |
|
135 | \maketitle | |
|
136 | ||||
|
137 | ((* block toc *)) | |||
135 | \tableofcontents |
|
138 | \tableofcontents | |
|
139 | ((* endblock toc *)) | |||
136 |
|
140 | |||
137 | ((* endblock bodyBegin *))((( super() )))((* block bodyEnd *)) |
|
141 | ((* endblock bodyBegin *))((( super() )))((* block bodyEnd *)) | |
138 |
|
142 | |||
@@ -215,10 +219,12 b' Note: For best display, use latex syntax highlighting. =))' | |||||
215 | % Input |
|
219 | % Input | |
216 | %============================================================================== |
|
220 | %============================================================================== | |
217 | ((* block input *)) |
|
221 | ((* block input *)) | |
218 | ((* if resources.sphinx.outputstyle == 'simple' *)) |
|
222 | ||
219 |
|
|
223 | % Make sure that atleast 4 lines are below the HR | |
220 |
|
|
224 | \needspace{((( min_header_lines )))\baselineskip} | |
221 |
|
225 | |||
|
226 | ((* if resources.sphinx.outputstyle == 'simple' *)) | |||
|
227 | ||||
222 | % Add a horizantal break, along with break title. |
|
228 | % Add a horizantal break, along with break title. | |
223 | \vspace{10pt} |
|
229 | \vspace{10pt} | |
224 | {\scriptsize Input}\\* |
|
230 | {\scriptsize Input}\\* | |
@@ -229,9 +235,11 b' Note: For best display, use latex syntax highlighting. =))' | |||||
229 | ((( cell.input | highlight ))) |
|
235 | ((( cell.input | highlight ))) | |
230 |
|
236 | |||
231 | ((* elif resources.sphinx.outputstyle == 'notebook' *)) |
|
237 | ((* elif resources.sphinx.outputstyle == 'notebook' *)) | |
232 | \textbf{In {[}((( cell.prompt_number ))){]}:}\\* |
|
238 | \vspace{5pt} | |
233 | \vspace{-2.4\baselineskip} |
|
239 | {\color{nbframe-prompt}\textbf{In {[}((( cell.prompt_number ))){]}:}}\\* | |
|
240 | \vspace{-2.6\baselineskip} | |||
234 | \begin{ColorVerbatim} |
|
241 | \begin{ColorVerbatim} | |
|
242 | \vspace{-0.5\baselineskip} | |||
235 | ((( cell.input | highlight ))) |
|
243 | ((( cell.input | highlight ))) | |
236 | \end{ColorVerbatim} |
|
244 | \end{ColorVerbatim} | |
237 | ((* endif *)) |
|
245 | ((* endif *)) | |
@@ -244,6 +252,7 b' Note: For best display, use latex syntax highlighting. =))' | |||||
244 | % once. By keeping track of when an input group is started |
|
252 | % once. By keeping track of when an input group is started | |
245 | %============================================================================== |
|
253 | %============================================================================== | |
246 | ((* block output_group *)) |
|
254 | ((* block output_group *)) | |
|
255 | ((* if cell.outputs.__len__() > 0 *)) | |||
247 | ((* if resources.sphinx.outputstyle == 'simple' *)) |
|
256 | ((* if resources.sphinx.outputstyle == 'simple' *)) | |
248 |
|
257 | |||
249 | % If the first block is an image, minipage the image. Else |
|
258 | % If the first block is an image, minipage the image. Else | |
@@ -278,6 +287,7 b' Note: For best display, use latex syntax highlighting. =))' | |||||
278 | ((* endfor *)) |
|
287 | ((* endfor *)) | |
279 | \end{ColorVerbatim} |
|
288 | \end{ColorVerbatim} | |
280 | ((* endif *)) |
|
289 | ((* endif *)) | |
|
290 | ((* endif *)) | |||
281 | ((* endblock *)) |
|
291 | ((* endblock *)) | |
282 |
|
292 | |||
283 | %============================================================================== |
|
293 | %============================================================================== | |
@@ -302,6 +312,10 b' Note: For best display, use latex syntax highlighting. =))' | |||||
302 | ((( insert_graphics(output.key_svg) ))) |
|
312 | ((( insert_graphics(output.key_svg) ))) | |
303 | ((*- endblock -*)) |
|
313 | ((*- endblock -*)) | |
304 |
|
314 | |||
|
315 | ((*- block data_latex *)) | |||
|
316 | ((( output.latex ))) | |||
|
317 | ((* endblock -*)) | |||
|
318 | ||||
305 | %============================================================================== |
|
319 | %============================================================================== | |
306 | % Support Macros |
|
320 | % Support Macros | |
307 | %============================================================================== |
|
321 | %============================================================================== | |
@@ -309,22 +323,14 b' Note: For best display, use latex syntax highlighting. =))' | |||||
309 | % Name: render_output |
|
323 | % Name: render_output | |
310 | % Purpose: Renders an output block appropriately. |
|
324 | % Purpose: Renders an output block appropriately. | |
311 | ((* macro render_output(output) -*)) |
|
325 | ((* macro render_output(output) -*)) | |
312 |
((*- if output.output_type == 'py |
|
326 | ((*- if output.output_type == 'pyerr' -*)) | |
313 |
((*- block py |
|
327 | ((*- block pyerr scoped *)) | |
314 | ((( custom_verbatim(super()) ))) |
|
328 | ((( custom_verbatim(super()) ))) | |
315 |
((* |
|
329 | ((* endblock pyerr -*)) | |
316 | ((*- elif output.output_type == 'stream' -*)) |
|
330 | ((*- else -*)) | |
317 | ((*- block stream scoped -*)) |
|
|||
318 | ((( custom_verbatim(output.text) ))) |
|
|||
319 | ((*- endblock stream -*)) |
|
|||
320 | ((*- elif output.output_type == 'display_data' -*)) |
|
|||
321 | ((*- block display_data scoped -*)) |
|
331 | ((*- block display_data scoped -*)) | |
322 | ((( super() ))) |
|
332 | ((( super() ))) | |
323 | ((*- endblock display_data -*)) |
|
333 | ((*- endblock display_data -*)) | |
324 | ((*- elif output.output_type == 'pyerr' -*)) |
|
|||
325 | ((*- block pyerr scoped -*)) |
|
|||
326 | ((( custom_verbatim(super()) ))) |
|
|||
327 | ((*- endblock pyerr -*)) |
|
|||
328 | ((*- endif -*)) |
|
334 | ((*- endif -*)) | |
329 | ((*- endmacro *)) |
|
335 | ((*- endmacro *)) | |
330 |
|
336 |
General Comments 0
You need to be logged in to leave comments.
Login now