Show More
@@ -27,9 +27,9 b' Note: For best display, use latex syntax highlighting. =))' | |||||
27 | % edges of latex pages (since latex does not always seem smart enough |
|
27 | % edges of latex pages (since latex does not always seem smart enough | |
28 | % to prevent this in some cases.) This is only applied to textual output |
|
28 | % to prevent this in some cases.) This is only applied to textual output | |
29 | ((* if resources.sphinx.outputstyle == 'simple' *)) |
|
29 | ((* if resources.sphinx.outputstyle == 'simple' *)) | |
30 |
((*- set wrap_size = 85 -*)) |
|
30 | ((*- set wrap_size = 85 -*)) | |
31 | ((* elif resources.sphinx.outputstyle == 'notebook' *)) |
|
31 | ((* elif resources.sphinx.outputstyle == 'notebook' *)) | |
32 |
((*- set wrap_size = 70 -*)) |
|
32 | ((*- set wrap_size = 70 -*)) | |
33 | ((* endif *)) |
|
33 | ((* endif *)) | |
34 |
|
34 | |||
35 | %============================================================================== |
|
35 | %============================================================================== | |
@@ -68,7 +68,7 b' Note: For best display, use latex syntax highlighting. =))' | |||||
68 | % Pygments requirements |
|
68 | % Pygments requirements | |
69 | \usepackage{fancyvrb} |
|
69 | \usepackage{fancyvrb} | |
70 | \usepackage{color} |
|
70 | \usepackage{color} | |
71 |
|
71 | |||
72 | % Needed to box output/input |
|
72 | % Needed to box output/input | |
73 | \usepackage{mdframed} |
|
73 | \usepackage{mdframed} | |
74 | \usepackage{alltt} |
|
74 | \usepackage{alltt} | |
@@ -77,7 +77,7 b' Note: For best display, use latex syntax highlighting. =))' | |||||
77 | \usepackage{graphicx} |
|
77 | \usepackage{graphicx} | |
78 | \graphicspath{ {figs/} } |
|
78 | \graphicspath{ {figs/} } | |
79 | \usepackage[export]{adjustbox} % To resize |
|
79 | \usepackage[export]{adjustbox} % To resize | |
80 |
|
80 | |||
81 |
|
81 | |||
82 | % For formatting output while also word wrapping. |
|
82 | % For formatting output while also word wrapping. | |
83 | \usepackage{listings} |
|
83 | \usepackage{listings} | |
@@ -86,17 +86,17 b' Note: For best display, use latex syntax highlighting. =))' | |||||
86 |
|
86 | |||
87 | %Pygments definitions |
|
87 | %Pygments definitions | |
88 | ((( resources.sphinx.pygment_definitions ))) |
|
88 | ((( resources.sphinx.pygment_definitions ))) | |
89 |
|
89 | |||
90 | %Set pygments styles if needed... |
|
90 | %Set pygments styles if needed... | |
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 | \definecolor{nbframe-prompt}{rgb}{0.05,0.05,0.3} | |
95 |
|
95 | |||
96 | \newenvironment{ColorVerbatim} |
|
96 | \newenvironment{ColorVerbatim} | |
97 | {\begin{mdframed}[backgroundcolor=nbframe-bg, userdefinedwidth=1\linewidth, leftmargin=0.08\linewidth, linecolor=nbframe-border, linewidth=1pt, usetwoside=false]} |
|
97 | {\begin{mdframed}[backgroundcolor=nbframe-bg, userdefinedwidth=1\linewidth, leftmargin=0.08\linewidth, linecolor=nbframe-border, linewidth=1pt, usetwoside=false]} | |
98 | {\end{mdframed}} |
|
98 | {\end{mdframed}} | |
99 |
|
99 | |||
100 | \renewenvironment{Verbatim}[1][\unskip] |
|
100 | \renewenvironment{Verbatim}[1][\unskip] | |
101 | {\begin{alltt}} |
|
101 | {\begin{alltt}} | |
102 | {\end{alltt}} |
|
102 | {\end{alltt}} | |
@@ -112,13 +112,13 b' Note: For best display, use latex syntax highlighting. =))' | |||||
112 | \release{((( nb.metadata._draft.version | escape_tex )))} |
|
112 | \release{((( nb.metadata._draft.version | escape_tex )))} | |
113 | \author{((( nb.metadata._draft.author | escape_tex )))} |
|
113 | \author{((( nb.metadata._draft.author | escape_tex )))} | |
114 | \renewcommand{\releasename}{((( nb.metadata._draft.release | escape_tex )))} |
|
114 | \renewcommand{\releasename}{((( nb.metadata._draft.release | escape_tex )))} | |
115 |
|
115 | |||
116 | % TODO: Add option for the user to specify a logo for his/her export. |
|
116 | % TODO: Add option for the user to specify a logo for his/her export. | |
117 | \newcommand{\sphinxlogo}{} |
|
117 | \newcommand{\sphinxlogo}{} | |
118 |
|
118 | |||
119 | % Make the index page of the document. |
|
119 | % Make the index page of the document. | |
120 | \makeindex |
|
120 | \makeindex | |
121 |
|
121 | |||
122 | % Import sphinx document type specifics. |
|
122 | % Import sphinx document type specifics. | |
123 | ((* block sphinxheader *))((* endblock sphinxheader *)) |
|
123 | ((* block sphinxheader *))((* endblock sphinxheader *)) | |
124 | ((* endblock header *)) |
|
124 | ((* endblock header *)) | |
@@ -132,11 +132,11 b' Note: For best display, use latex syntax highlighting. =))' | |||||
132 |
|
132 | |||
133 | % Start of the document |
|
133 | % Start of the document | |
134 | \begin{document} |
|
134 | \begin{document} | |
135 |
|
135 | |||
136 | ((* if resources.sphinx.header *)) |
|
136 | ((* if resources.sphinx.header *)) | |
137 | \maketitle |
|
137 | \maketitle | |
138 | ((* endif *)) |
|
138 | ((* endif *)) | |
139 |
|
139 | |||
140 | ((* block toc *)) |
|
140 | ((* block toc *)) | |
141 | \tableofcontents |
|
141 | \tableofcontents | |
142 | ((* endblock toc *)) |
|
142 | ((* endblock toc *)) | |
@@ -178,7 +178,7 b' Note: For best display, use latex syntax highlighting. =))' | |||||
178 | ((* block h5 -*))subsubsection((* endblock h5 -*)) |
|
178 | ((* block h5 -*))subsubsection((* endblock h5 -*)) | |
179 | ((*- elif cell.level == 6 -*)) |
|
179 | ((*- elif cell.level == 6 -*)) | |
180 | ((* block h6 -*))paragraph((* endblock h6 -*)) |
|
180 | ((* block h6 -*))paragraph((* endblock h6 -*)) | |
181 |
|
181 | |||
182 | ((= It's important to make sure that underscores (which tend to be common |
|
182 | ((= It's important to make sure that underscores (which tend to be common | |
183 | in IPYNB file titles) do not make their way into latex. Sometimes this |
|
183 | in IPYNB file titles) do not make their way into latex. Sometimes this | |
184 | causes latex to barf. =)) |
|
184 | causes latex to barf. =)) | |
@@ -225,7 +225,7 b' Note: For best display, use latex syntax highlighting. =))' | |||||
225 |
|
225 | |||
226 | % Make sure that atleast 4 lines are below the HR |
|
226 | % Make sure that atleast 4 lines are below the HR | |
227 | \needspace{((( min_header_lines )))\baselineskip} |
|
227 | \needspace{((( min_header_lines )))\baselineskip} | |
228 |
|
228 | |||
229 | ((* if resources.sphinx.outputstyle == 'simple' *)) |
|
229 | ((* if resources.sphinx.outputstyle == 'simple' *)) | |
230 |
|
230 | |||
231 | % Add a horizantal break, along with break title. |
|
231 | % Add a horizantal break, along with break title. | |
@@ -236,7 +236,7 b' Note: For best display, use latex syntax highlighting. =))' | |||||
236 |
|
236 | |||
237 | % Add contents below. |
|
237 | % Add contents below. | |
238 | ((( cell.input | highlight ))) |
|
238 | ((( cell.input | highlight ))) | |
239 |
|
239 | |||
240 | ((* elif resources.sphinx.outputstyle == 'notebook' *)) |
|
240 | ((* elif resources.sphinx.outputstyle == 'notebook' *)) | |
241 | \vspace{5pt} |
|
241 | \vspace{5pt} | |
242 | {\color{nbframe-prompt}\textbf{In {[}((( cell.prompt_number ))){]}:}}\\* |
|
242 | {\color{nbframe-prompt}\textbf{In {[}((( cell.prompt_number ))){]}:}}\\* | |
@@ -257,11 +257,11 b' Note: For best display, use latex syntax highlighting. =))' | |||||
257 | ((* block output_group *)) |
|
257 | ((* block output_group *)) | |
258 | ((* if cell.outputs.__len__() > 0 *)) |
|
258 | ((* if cell.outputs.__len__() > 0 *)) | |
259 | ((* if resources.sphinx.outputstyle == 'simple' *)) |
|
259 | ((* if resources.sphinx.outputstyle == 'simple' *)) | |
260 |
|
260 | |||
261 | % If the first block is an image, minipage the image. Else |
|
261 | % If the first block is an image, minipage the image. Else | |
262 | % request a certain amount of space for the input text. |
|
262 | % request a certain amount of space for the input text. | |
263 | ((( iff_figure(cell.outputs[0], "\\begin{minipage}{1.0\\textwidth}", "\\needspace{" ~ min_header_lines ~ "\\baselineskip}") ))) |
|
263 | ((( iff_figure(cell.outputs[0], "\\begin{minipage}{1.0\\textwidth}", "\\needspace{" ~ min_header_lines ~ "\\baselineskip}") ))) | |
264 |
|
264 | |||
265 | % Add a horizantal break, along with break title. |
|
265 | % Add a horizantal break, along with break title. | |
266 | \vspace{10pt} |
|
266 | \vspace{10pt} | |
267 | {\scriptsize Output}\\* |
|
267 | {\scriptsize Output}\\* | |
@@ -279,10 +279,10 b' Note: For best display, use latex syntax highlighting. =))' | |||||
279 | ((( render_output(output) ))) |
|
279 | ((( render_output(output) ))) | |
280 | ((* endfor *)) |
|
280 | ((* endfor *)) | |
281 | ((* elif resources.sphinx.outputstyle == 'notebook' *)) |
|
281 | ((* elif resources.sphinx.outputstyle == 'notebook' *)) | |
282 |
|
282 | |||
283 | %Skip one line down. |
|
283 | %Skip one line down. | |
284 | \vspace{1\baselineskip} |
|
284 | \vspace{1\baselineskip} | |
285 |
|
285 | |||
286 | % Add document contents. |
|
286 | % Add document contents. | |
287 | \begin{ColorVerbatim} |
|
287 | \begin{ColorVerbatim} | |
288 | ((* for output in cell.outputs *)) |
|
288 | ((* for output in cell.outputs *)) | |
@@ -316,7 +316,7 b' Note: For best display, use latex syntax highlighting. =))' | |||||
316 | ((*- endblock -*)) |
|
316 | ((*- endblock -*)) | |
317 |
|
317 | |||
318 | ((*- block data_latex -*)) |
|
318 | ((*- block data_latex -*)) | |
319 |
((( center_output(output.latex | rm_math_space) ))) |
|
319 | ((( center_output(output.latex | rm_math_space) ))) | |
320 | ((*- endblock -*)) |
|
320 | ((*- endblock -*)) | |
321 |
|
321 | |||
322 | %============================================================================== |
|
322 | %============================================================================== | |
@@ -328,7 +328,7 b' Note: For best display, use latex syntax highlighting. =))' | |||||
328 | ((* macro render_output(output) -*)) |
|
328 | ((* macro render_output(output) -*)) | |
329 | ((*- if output.output_type == 'pyerr' -*)) |
|
329 | ((*- if output.output_type == 'pyerr' -*)) | |
330 | ((*- block pyerr scoped *)) |
|
330 | ((*- block pyerr scoped *)) | |
331 |
((( custom_verbatim(super()) ))) |
|
331 | ((( custom_verbatim(super()) ))) | |
332 | ((* endblock pyerr -*)) |
|
332 | ((* endblock pyerr -*)) | |
333 | ((*- else -*)) |
|
333 | ((*- else -*)) | |
334 | ((*- block display_data scoped -*)) |
|
334 | ((*- block display_data scoped -*)) | |
@@ -361,7 +361,7 b' Note: For best display, use latex syntax highlighting. =))' | |||||
361 | ((* macro custom_verbatim(text) -*)) |
|
361 | ((* macro custom_verbatim(text) -*)) | |
362 | \begin{alltt} |
|
362 | \begin{alltt} | |
363 | ((( center_output(text | wrap(wrap_size)) ))) |
|
363 | ((( center_output(text | wrap(wrap_size)) ))) | |
364 |
\end{alltt} |
|
364 | \end{alltt} | |
365 | ((*- endmacro *)) |
|
365 | ((*- endmacro *)) | |
366 |
|
366 | |||
367 | % Name: center_output |
|
367 | % Name: center_output |
General Comments 0
You need to be logged in to leave comments.
Login now