##// END OF EJS Templates
Redo of fixing templates structure.
damianavila -
Show More
@@ -1,138 +1,142
1 1 {%- extends 'display_priority.tpl' -%}
2 2
3 3
4
5 4 {% block codecell %}
6 5 <div class="cell border-box-sizing code_cell vbox">
7 {{ super() }}</div>
6 {{ super() }}
7 </div>
8 8 {%- endblock codecell %}
9 9
10 10 {% block input_group -%}
11 11 <div class="input hbox">
12 {{super()}}
12 {{ super() }}
13 13 </div>
14 14 {% endblock input_group %}
15 15
16 16 {% block output_group %}
17 17 <div class="vbox output_wrapper">
18 18 <div class="output vbox">
19 19 {{ super() }}
20 20 </div>
21 21 </div>
22 22 {% endblock output_group %}
23 23
24 24 {% block in_prompt -%}
25 <div class="prompt input_prompt">In&nbsp;[{{cell.prompt_number}}]:</div>
25 <div class="prompt input_prompt">
26 In&nbsp;[{{ cell.prompt_number }}]:
27 </div>
26 28 {%- endblock in_prompt %}
27 29
28 30 {#
29 31 output_prompt doesn't do anything in HTML,
30 32 because there is a prompt div in each output area (see output block)
31 33 #}
32 34 {% block output_prompt %}
33 35 {% endblock output_prompt %}
34 36
35 37 {% block input %}
36 38 <div class="input_area box-flex1">
37 {{cell.input | highlight2html }}
39 {{ cell.input | highlight2html }}
38 40 </div>
39 41 {%- endblock input %}
40 42
41 43 {% block output %}
42 44 <div class="hbox output_area">
43 45 {%- if output.output_type == 'pyout' -%}
44 <div class="prompt output_prompt">
45 Out[{{cell.prompt_number}}]:
46 <div class="prompt output_prompt">
47 Out[{{ cell.prompt_number }}]:
46 48 {%- else -%}
47 <div class="prompt">
49 <div class="prompt">
48 50 {%- endif -%}
49 </div>
51 </div>
50 52 {{ super() }}
51 53 </div>
52 54 {% endblock output %}
53 55
54 56 {% block markdowncell scoped %}
55 57 <div class="text_cell_render border-box-sizing rendered_html">
56 {{ cell.source | strip_math_space | markdown2html | strip_files_prefix}}
58 {{ cell.source | strip_math_space | markdown2html | strip_files_prefix }}
57 59 </div>
58 60 {%- endblock markdowncell %}
59 61
60 62 {% block headingcell scoped %}
61 63 <div class="text_cell_render border-box-sizing rendered_html">
62 {{("#" * cell.level + cell.source) | replace('\n', ' ') | strip_math_space | markdown2html | strip_files_prefix | add_anchor }}
64 {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | strip_math_space | markdown2html | strip_files_prefix | add_anchor }}
63 65 </div>
64 66 {% endblock headingcell %}
65 67
66 68 {% block rawcell scoped %}
67 69 {{ cell.source }}
68 70 {% endblock rawcell %}
69 71
70 72 {% block unknowncell scoped %}
71 unknown type {{cell.type}}
73 unknown type {{ cell.type }}
72 74 {% endblock unknowncell %}
73 75
74
75 76 {% block pyout -%}
76 77 <div class="box-flex1 output_subarea output_pyout">
77 {% block data_priority scoped %}{{ super()}}{% endblock %}
78 {% block data_priority scoped %}
79 {{ super() }}
80 {% endblock %}
78 81 </div>
79 82 {%- endblock pyout %}
80 83
81 84 {% block stream_stdout -%}
82 85 <div class="box-flex1 output_subarea output_stream output_stdout">
83 <pre>{{output.text |ansi2html}}</pre>
86 <pre>
87 {{ output.text | ansi2html }}
88 </pre>
84 89 </div>
85 90 {%- endblock stream_stdout %}
86 91
87 92 {% block stream_stderr -%}
88 93 <div class="box-flex1 output_subarea output_stream output_stderr">
89 <pre>{{output.text |ansi2html}}</pre>
94 <pre>
95 {{ output.text | ansi2html }}
96 </pre>
90 97 </div>
91 98 {%- endblock stream_stderr %}
92 99
93 100 {% block data_svg -%}
94 {{output.svg}}
101 {{ output.svg }}
95 102 {%- endblock data_svg %}
96 103
97
98 104 {% block data_html -%}
99 105 <div class="output_html rendered_html">
100 {{output.html}}
106 {{ output.html }}
101 107 </div>
102 108 {%- endblock data_html %}
103 109
104 110 {% block data_png %}
105 <img src="data:image/png;base64,{{output.png}}">
111 <img src="data:image/png;base64,{{ output.png }}">
106 112 {%- endblock data_png %}
107 113
108
109 114 {% block data_jpg %}
110 <img src="data:image/jpeg;base64,{{output.jpeg}}">
115 <img src="data:image/jpeg;base64,{{ output.jpeg }}">
111 116 {%- endblock data_jpg %}
112 117
113
114 118 {% block data_latex %}
115 {{output.latex}}
119 {{ output.latex }}
116 120 {%- endblock data_latex %}
117 121
118 122 {% block pyerr -%}
119 123 <div class="box-flex1 output_subarea output_pyerr">
120 <pre>{{super()}}</pre>
124 <pre>{{ super() }}</pre>
121 125 </div>
122 126 {%- endblock pyerr %}
123 127
124 128 {%- block traceback_line %}
125 {{line| ansi2html}}
129 {{ line | ansi2html }}
126 130 {%- endblock traceback_line %}
127 131
128
129 132 {%- block data_text %}
130 <pre>{{output.text | ansi2html}}</pre>
133 <pre>
134 {{ output.text | ansi2html }}
135 </pre>
131 136 {%- endblock -%}
132 137
133
134 138 {%- block display_data scoped -%}
135 139 <div class="box-flex1 output_subarea output_display_data">
136 {{super()}}
140 {{ super() }}
137 141 </div>
138 {%- endblock display_data -%}
142 {%- endblock display_data -%} No newline at end of file
@@ -1,68 +1,68
1 1 {%- extends 'html_basic.tpl' -%}
2 2
3 {%- block header -%}<!DOCTYPE html>
3
4 {%- block header -%}
5 <!DOCTYPE html>
4 6 <html>
5 7 <head>
6 8 <meta charset="UTF-8">
7 9 <title>[{{nb.metadata.name}}]</title>
8 10 {% for css in resources.inlining.css -%}
9 <style type="text/css">
10 {{css}}
11 </style>
11 <style type="text/css">
12 {{ css }}
13 </style>
12 14 {% endfor %}
13 15
14 16 <style type="text/css">
15 17 /* Overrides of notebook CSS for static HTML export */
16 18 body {
17 19 overflow: visible;
18 20 padding: 8px;
19 21 }
20 22 .input_area {
21 23 padding: 0.2em;
22 24 }
23 25
24 26 pre {
25 27 padding: 0.2em;
26 28 border: none;
27 29 margin: 0px;
28 30 font-size: 13px;
29 31 }
30 32 </style>
31 33
32 34 <!-- Custom stylesheet, it must be in the same directory as the html file -->
33 35 <link rel="stylesheet" href="custom.css">
34 36
35 <script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript">
36
37 </script>
37 <script src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript"></script>
38 38 <script type="text/javascript">
39 39 init_mathjax = function() {
40 40 if (window.MathJax) {
41 41 // MathJax loaded
42 42 MathJax.Hub.Config({
43 43 tex2jax: {
44 44 inlineMath: [ ['$','$'], ["\\(","\\)"] ],
45 45 displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
46 46 },
47 47 displayAlign: 'left', // Change this to 'center' to center equations.
48 48 "HTML-CSS": {
49 49 styles: {'.MathJax_Display': {"margin": 0}}
50 50 }
51 51 });
52 52 MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
53 53 }
54 54 }
55 55 init_mathjax();
56 56 </script>
57 57 </head>
58 58 {%- endblock header -%}
59 59
60
61 60 {% block body %}
62 <body>{{ super() }}
61 <body>
62 {{ super() }}
63 63 </body>
64 64 {%- endblock body %}
65 65
66
67 66 {% block footer %}
68 </html>{% endblock footer %}
67 </html>
68 {% endblock footer %} No newline at end of file
@@ -1,25 +1,29
1 1 ((============================================================================
2 2 NBConvert Sphinx-Latex HowTo Template
3 3
4 4 Purpose: Allow export of PDF friendly Latex inspired by Sphinx HowTo
5 5 document style. Most of the is derived directly from Sphinx source.
6 6
7 7 Inheritance: null>display_priority>sphinx
8 8
9 9 ==========================================================================))
10 10
11 11 ((*- extends 'sphinx.tplx' -*))
12 12
13
14
15
16
13 17 ((* set parentdocumentclass = 'article' *))
14 18 ((* set documentclass = 'howto' *))
15 19
16 20 ((* block h1 -*))part((* endblock h1 -*))
17 21 ((* block h2 -*))section((* endblock h2 -*))
18 22 ((* block h3 -*))subsection((* endblock h3 -*))
19 23 ((* block h4 -*))subsubsection((* endblock h4 -*))
20 24 ((* block h5 -*))paragraph((* endblock h5 -*))
21 25 ((* block h6 -*))subparagraph((* endblock h6 -*))
22 26
23 27 % Diasble table of contents for howto
24 28 ((* block toc *))
25 29 ((* endblock toc *))
@@ -1,260 +1,269
1 1 ((*- extends 'display_priority.tplx' -*))
2 2
3
3 4 \nonstopmode
4 5
5 ((* block in_prompt *))((* endblock in_prompt *))
6 ((* block in_prompt *))
7 ((* endblock in_prompt *))
6 8
7 ((* block output_prompt *))((* endblock output_prompt *))
9 ((* block output_prompt *))
10 ((* endblock output_prompt *))
8 11
9 ((* block codecell *))\begin{codecell}((( super() )))
12 ((* block codecell *))
13 \begin{codecell}
14 ((( super() )))
10 15 \end{codecell}
11 16 ((* endblock *))
12 17
13 18 ((* block input *))
14 19 \begin{codeinput}
15 20 \begin{lstlisting}
16 21 ((( cell.input )))
17 22 \end{lstlisting}
18 23 \end{codeinput}
19 24 ((* endblock input *))
20 25
21
22 26 ((= Those Two are for error displaying
23 27 even if the first one seem to do nothing,
24 28 it introduces a new line
25
26 29 =))
30
27 31 ((* block pyerr *))
28 32 \begin{traceback}
29 \begin{verbatim}((( super() )))
33 \begin{verbatim}
34 ((( super() )))
30 35 \end{verbatim}
31 36 \end{traceback}
32 37 ((* endblock pyerr *))
33 38
34 39 ((* block traceback_line *))
35 ((( line |indent| strip_ansi )))((* endblock traceback_line *))
40 ((( line | indent | strip_ansi )))
41 ((* endblock traceback_line *))
36 42 ((= .... =))
37 43
38
39 44 ((*- block output_group -*))
40 45 \begin{codeoutput}
41 46 ((( super() )))
42 \end{codeoutput}((* endblock *))
47 \end{codeoutput}
48 ((* endblock *))
43 49
44 50 ((*- block data_png -*))
45 51 \begin{center}
46 \includegraphics[max size={0.7\textwidth}{0.9\textheight}]{(((output.png_filename)))}
52 \includegraphics[max size={0.7\textwidth}{0.9\textheight}]{((( output.png_filename )))}
47 53 \par
48 54 \end{center}
49 55 ((*- endblock -*))
50 56
51 57 ((*- block data_jpg -*))
52 58 \begin{center}
53 \includegraphics[max size={0.7\textwidth}{0.9\textheight}]{(((output.jpeg_filename)))}
59 \includegraphics[max size={0.7\textwidth}{0.9\textheight}]{((( output.jpeg_filename )))}
54 60 \par
55 61 \end{center}
56 62 ((*- endblock -*))
57 63
58 64 ((*- block data_svg -*))
59 65 \begin{center}
60 \includegraphics[width=0.7\textwidth]{(((output.svg_filename)))}
66 \includegraphics[width=0.7\textwidth]{((( output.svg_filename )))}
61 67 \par
62 68 \end{center}
63 69 ((*- endblock -*))
64 70
65 71 ((*- block data_pdf -*))
66 72 \begin{center}
67 \includegraphics[width=0.7\textwidth]{(((output.pdf_filename)))}
73 \includegraphics[width=0.7\textwidth]{((( output.pdf_filename )))}
68 74 \par
69 75 \end{center}
70 76 ((*- endblock -*))
71 77
72 78 ((* block pyout *))
73 ((* block data_priority scoped *))((( super() )))((* endblock *))
79 ((* block data_priority scoped *))
80 ((( super() )))
81 ((* endblock *))
74 82 ((* endblock pyout *))
75 83
76 84 ((* block data_text *))
77 85 \begin{verbatim}
78 86 ((( output.text )))
79 87 \end{verbatim}
80 88 ((* endblock *))
81 89
82 90 ((* block data_latex -*))
83 91 ((*- if output.latex.startswith('$'): -*)) \begin{equation*}
84 ((( output.latex | strip_dollars)))
92 ((( output.latex | strip_dollars )))
85 93 \end{equation*}
86 ((*- else -*)) ((( output.latex ))) ((*- endif *))
94 ((*- else -*))
95 ((( output.latex )))
96 ((*- endif *))
87 97 ((* endblock *))
88 98
89 99 ((* block stream *))
90 100 \begin{Verbatim}[commandchars=\\\{\}]
91 ((( output.text | ansi2latex)))
101 ((( output.text | ansi2latex )))
92 102 \end{Verbatim}
93 103 ((* endblock stream *))
94 104
95 ((* block markdowncell scoped *))((( cell.source | markdown2latex )))
105 ((* block markdowncell scoped *))
106 ((( cell.source | markdown2latex )))
96 107 ((* endblock markdowncell *))
97 108
98 109 ((* block headingcell scoped -*))
99 ((( ('#' * cell.level + cell.source) | replace('\n', ' ') | markdown2latex )))
110 ((( ('#' * cell.level + cell.source) | replace('\n', ' ') | markdown2latex )))
100 111 ((* endblock headingcell *))
101 112
102 113 ((* block rawcell scoped *))
103 114 ((( cell.source | comment_lines )))
104 115 ((* endblock rawcell *))
105 116
106 117 ((* block unknowncell scoped *))
107 unknown type (((cell.type)))
118 unknown type ((( cell.type )))
108 119 ((* endblock unknowncell *))
109 120
110
111
112 121 ((* block body *))
113 122
114 123 ((* block bodyBegin *))
115 124 \begin{document}
116 125 ((* endblock bodyBegin *))
117 126
118 127 ((( super() )))
119 128
120 129 ((* block bodyEnd *))
121 130 \end{document}
122 131 ((* endblock bodyEnd *))
123 132 ((* endblock body *))
124 133
125 134 ((* block header *))
126 135 %% This file was auto-generated by IPython.
127 136 %% Conversion from the original notebook file:
128 137 %%
129 138 \documentclass[11pt,english]{article}
130 139
131 140 %% This is the automatic preamble used by IPython. Note that it does *not*
132 141 %% include a documentclass declaration, that is added at runtime to the overall
133 142 %% document.
134 143
135 144 \usepackage{amsmath}
136 145 \usepackage{amssymb}
137 146 \usepackage{graphicx}
138 147 \usepackage{ucs}
139 148 \usepackage[utf8x]{inputenc}
140 149
141 150 % Scale down larger images
142 151 \usepackage[export]{adjustbox}
143 152
144 153 %fancy verbatim
145 154 \usepackage{fancyvrb}
146 155 % needed for markdown enumerations to work
147 156 \usepackage{enumerate}
148 157
149 158 % Slightly bigger margins than the latex defaults
150 159 \usepackage{geometry}
151 160 \geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=2.5cm,rmargin=2.5cm}
152 161
153 162 % Define a few colors for use in code, links and cell shading
154 163 \usepackage{color}
155 164 \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
156 165 \definecolor{darkorange}{rgb}{.71,0.21,0.01}
157 166 \definecolor{darkgreen}{rgb}{.12,.54,.11}
158 167 \definecolor{myteal}{rgb}{.26, .44, .56}
159 168 \definecolor{gray}{gray}{0.45}
160 169 \definecolor{lightgray}{gray}{.95}
161 170 \definecolor{mediumgray}{gray}{.8}
162 171 \definecolor{inputbackground}{rgb}{.95, .95, .85}
163 172 \definecolor{outputbackground}{rgb}{.95, .95, .95}
164 173 \definecolor{traceback}{rgb}{1, .95, .95}
165 174
166 175 % new ansi colors
167 176 \definecolor{brown}{rgb}{0.54,0.27,0.07}
168 177 \definecolor{purple}{rgb}{0.5,0.0,0.5}
169 178 \definecolor{darkgray}{gray}{0.25}
170 179 \definecolor{lightred}{rgb}{1.0,0.39,0.28}
171 180 \definecolor{lightgreen}{rgb}{0.48,0.99,0.0}
172 181 \definecolor{lightblue}{rgb}{0.53,0.81,0.92}
173 182 \definecolor{lightpurple}{rgb}{0.87,0.63,0.87}
174 183 \definecolor{lightcyan}{rgb}{0.5,1.0,0.83}
175 184
176 185 % Framed environments for code cells (inputs, outputs, errors, ...). The
177 186 % various uses of \unskip (or not) at the end were fine-tuned by hand, so don't
178 187 % randomly change them unless you're sure of the effect it will have.
179 188 \usepackage{framed}
180 189
181 190 % remove extraneous vertical space in boxes
182 191 \setlength\fboxsep{0pt}
183 192
184 193 % codecell is the whole input+output set of blocks that a Code cell can
185 194 % generate.
186 195
187 196 % TODO: unfortunately, it seems that using a framed codecell environment breaks
188 197 % the ability of the frames inside of it to be broken across pages. This
189 198 % causes at least the problem of having lots of empty space at the bottom of
190 199 % pages as new frames are moved to the next page, and if a single frame is too
191 200 % long to fit on a page, will completely stop latex from compiling the
192 201 % document. So unless we figure out a solution to this, we'll have to instead
193 202 % leave the codecell env. as empty. I'm keeping the original codecell
194 203 % definition here (a thin vertical bar) for reference, in case we find a
195 204 % solution to the page break issue.
196 205
197 206 %% \newenvironment{codecell}{%
198 207 %% \def\FrameCommand{\color{mediumgray} \vrule width 1pt \hspace{5pt}}%
199 208 %% \MakeFramed{\vspace{-0.5em}}}
200 209 %% {\unskip\endMakeFramed}
201 210
202 211 % For now, make this a no-op...
203 212 \newenvironment{codecell}{}
204 213
205 214 \newenvironment{codeinput}{%
206 215 \def\FrameCommand{\colorbox{inputbackground}}%
207 216 \MakeFramed{\advance\hsize-\width \FrameRestore}}
208 217 {\unskip\endMakeFramed}
209 218
210 219 \newenvironment{codeoutput}{%
211 220 \def\FrameCommand{\colorbox{outputbackground}}%
212 221 \vspace{-1.4em}
213 222 \MakeFramed{\advance\hsize-\width \FrameRestore}}
214 223 {\unskip\medskip\endMakeFramed}
215 224
216 225 \newenvironment{traceback}{%
217 226 \def\FrameCommand{\colorbox{traceback}}%
218 227 \MakeFramed{\advance\hsize-\width \FrameRestore}}
219 228 {\endMakeFramed}
220 229
221 230 % Use and configure listings package for nicely formatted code
222 231 \usepackage{listingsutf8}
223 232 \lstset{
224 233 language=python,
225 234 inputencoding=utf8x,
226 235 extendedchars=\true,
227 236 aboveskip=\smallskipamount,
228 237 belowskip=\smallskipamount,
229 238 xleftmargin=2mm,
230 239 breaklines=true,
231 240 basicstyle=\small \ttfamily,
232 241 showstringspaces=false,
233 242 keywordstyle=\color{blue}\bfseries,
234 243 commentstyle=\color{myteal},
235 244 stringstyle=\color{darkgreen},
236 245 identifierstyle=\color{darkorange},
237 246 columns=fullflexible, % tighter character kerning, like verb
238 247 }
239 248
240 249 % The hyperref package gives us a pdf with properly built
241 250 % internal navigation ('pdf bookmarks' for the table of contents,
242 251 % internal cross-reference links, web links for URLs, etc.)
243 252 \usepackage{hyperref}
244 253 \hypersetup{
245 254 breaklinks=true, % so long urls are correctly broken across lines
246 255 colorlinks=true,
247 256 urlcolor=blue,
248 257 linkcolor=darkorange,
249 258 citecolor=darkgreen,
250 259 }
251 260
252 261 % hardcode size of all verbatim environments to be a bit smaller
253 262 \makeatletter
254 263 \g@addto@macro\@verbatim\small\topsep=0.5em\partopsep=0pt
255 264 \makeatother
256 265
257 266 % Prevent overflowing lines due to urls and other hard-to-break entities.
258 267 \sloppy
259 268
260 269 ((* endblock *))
@@ -1,21 +1,25
1 1 ((============================================================================
2 2 NBConvert Sphinx-Latex Manual Template
3 3
4 4 Purpose: Allow export of PDF friendly Latex inspired by Sphinx Manual
5 5 document style. Most of the is derived directly from Sphinx source.
6 6
7 7 Inheritance: null>display_priority>sphinx
8 8
9 9 ==========================================================================))
10 10
11 11 ((*- extends 'sphinx.tplx' -*))
12 12
13
14
15
16
13 17 ((* set parentdocumentclass = 'report' *))
14 18 ((* set documentclass = 'manual' *))
15 19
16 20 ((* block h1 -*))part((* endblock h1 -*))
17 21 ((* block h2 -*))chapter((* endblock h2 -*))
18 22 ((* block h3 -*))section((* endblock h3 -*))
19 23 ((* block h4 -*))subsection((* endblock h4 -*))
20 24 ((* block h5 -*))subsubsection((* endblock h5 -*))
21 25 ((* block h6 -*))paragraph((* endblock h6 -*))
@@ -1,452 +1,466
1 1 ((= NBConvert Sphinx-Latex Template
2 2
3 3 Purpose: Allow export of PDF friendly Latex inspired by Sphinx. Most of the
4 4 template is derived directly from Sphinx source.
5 5
6 6 Inheritance: null>display_priority
7 7
8 8 Note: For best display, use latex syntax highlighting. =))
9 9
10 10 ((*- extends 'display_priority.tplx' -*))
11 11
12
12 13 \nonstopmode
13 14
14 15 %==============================================================================
15 16 % Declarations
16 17 %==============================================================================
17 18
18 19 % In order to make sure that the input/output header follows the code it
19 20 % preceeds, the needspace package is used to request that a certain
20 21 % amount of lines (specified by this variable) are reserved. If those
21 22 % lines aren't available on the current page, the documenter will break
22 23 % to the next page and the header along with accomanying lines will be
23 24 % rendered together. This value specifies the number of lines that
24 25 % the header will be forced to group with without a page break.
25 26 ((*- set min_header_lines = 4 -*))
26 27
27 28 % This is the number of characters that are permitted per line. It's
28 29 % important that this limit is set so characters do not run off the
29 30 % edges of latex pages (since latex does not always seem smart enough
30 31 % to prevent this in some cases.) This is only applied to textual output
31 32 ((* if resources.sphinx.outputstyle == 'simple' *))
32 33 ((*- set wrap_size = 85 -*))
33 34 ((* elif resources.sphinx.outputstyle == 'notebook' *))
34 35 ((*- set wrap_size = 70 -*))
35 36 ((* endif *))
36 37
37 38 %==============================================================================
38 39 % Header
39 40 %==============================================================================
40 41 ((* block header *))
41 42
42 43 % Header, overrides base
43 44
44 45 % Make sure that the sphinx doc style knows who it inherits from.
45 46 \def\sphinxdocclass{(((parentdocumentclass)))}
46 47
47 48 % Declare the document class
48 49 \documentclass[letterpaper,10pt,english]{((( resources.sphinx.texinputs )))/sphinx(((documentclass)))}
49 50
50 51 % Imports
51 52 \usepackage[utf8]{inputenc}
52 53 \DeclareUnicodeCharacter{00A0}{\\nobreakspace}
53 54 \usepackage[T1]{fontenc}
54 55 \usepackage{babel}
55 56 \usepackage{times}
56 57 \usepackage{import}
57 58 \usepackage[((( resources.sphinx.chapterstyle )))]{((( resources.sphinx.texinputs )))/fncychap}
58 59 \usepackage{longtable}
59 60 \usepackage{((( resources.sphinx.texinputs )))/sphinx}
60 61 \usepackage{multirow}
61 62
62 63 \usepackage{amsmath}
63 64 \usepackage{amssymb}
64 65 \usepackage{ucs}
65 66 \usepackage{enumerate}
66 67
67 68 % Used to make the Input/Output rules follow around the contents.
68 69 \usepackage{needspace}
69 70
70 71 % Pygments requirements
71 72 \usepackage{fancyvrb}
72 73 \usepackage{color}
73 74 % ansi colors additions
74 75 \definecolor{darkgreen}{rgb}{.12,.54,.11}
75 76 \definecolor{lightgray}{gray}{.95}
76 77 \definecolor{brown}{rgb}{0.54,0.27,0.07}
77 78 \definecolor{purple}{rgb}{0.5,0.0,0.5}
78 79 \definecolor{darkgray}{gray}{0.25}
79 80 \definecolor{lightred}{rgb}{1.0,0.39,0.28}
80 81 \definecolor{lightgreen}{rgb}{0.48,0.99,0.0}
81 82 \definecolor{lightblue}{rgb}{0.53,0.81,0.92}
82 83 \definecolor{lightpurple}{rgb}{0.87,0.63,0.87}
83 84 \definecolor{lightcyan}{rgb}{0.5,1.0,0.83}
84 85
85 86 % Needed to box output/input
86 87 \usepackage{tikz}
87 88 \usetikzlibrary{calc,arrows,shadows}
88 89 \usepackage[framemethod=tikz]{mdframed}
89 90
90 91 \usepackage{alltt}
91 92
92 93 % Used to load and display graphics
93 94 \usepackage{graphicx}
94 95 \graphicspath{ {figs/} }
95 96 \usepackage[Export]{adjustbox} % To resize
96 97
97 98
98 99 % For formatting output while also word wrapping.
99 100 \usepackage{listings}
100 101 \lstset{breaklines=true}
101 102 \lstset{basicstyle=\small\ttfamily}
102 103 \def\smaller{\fontsize{9.5pt}{9.5pt}\selectfont}
103 104
104 105 %Pygments definitions
105 106 ((( resources.sphinx.pygment_definitions )))
106 107
107 108 %Set pygments styles if needed...
108 109 ((* if resources.sphinx.outputstyle == 'notebook' *))
109 110 \definecolor{nbframe-border}{rgb}{0.867,0.867,0.867}
110 111 \definecolor{nbframe-bg}{rgb}{0.969,0.969,0.969}
111 112 \definecolor{nbframe-in-prompt}{rgb}{0.0,0.0,0.502}
112 113 \definecolor{nbframe-out-prompt}{rgb}{0.545,0.0,0.0}
113 114
114 115 \newenvironment{ColorVerbatim}
115 116 {\begin{mdframed}[%
116 117 roundcorner=1.0pt, %
117 118 backgroundcolor=nbframe-bg, %
118 119 userdefinedwidth=1\linewidth, %
119 120 leftmargin=0.1\linewidth, %
120 121 innerleftmargin=0pt, %
121 122 innerrightmargin=0pt, %
122 123 linecolor=nbframe-border, %
123 124 linewidth=1pt, %
124 125 usetwoside=false, %
125 126 everyline=true, %
126 127 innerlinewidth=3pt, %
127 128 innerlinecolor=nbframe-bg, %
128 129 middlelinewidth=1pt, %
129 130 middlelinecolor=nbframe-bg, %
130 131 outerlinewidth=0.5pt, %
131 132 outerlinecolor=nbframe-border, %
132 133 needspace=0pt
133 134 ]}
134 135 {\end{mdframed}}
135 136
136 137 \newenvironment{InvisibleVerbatim}
137 138 {\begin{mdframed}[leftmargin=0.1\linewidth,innerleftmargin=3pt,innerrightmargin=3pt, userdefinedwidth=1\linewidth, linewidth=0pt, linecolor=white, usetwoside=false]}
138 139 {\end{mdframed}}
139 140
140 141 \renewenvironment{Verbatim}[1][\unskip]
141 142 {\begin{alltt}\smaller}
142 143 {\end{alltt}}
143 144 ((* endif *))
144 145
145 146 % Help prevent overflowing lines due to urls and other hard-to-break
146 147 % entities. This doesn't catch everything...
147 148 \sloppy
148 149
149 150 % Document level variables
150 151 \title{((( resources.metadata.name | escape_latex )))}
151 152 \date{((( resources.sphinx.date | escape_latex )))}
152 153 \release{((( resources.sphinx.version | escape_latex )))}
153 154 \author{((( resources.sphinx.author | escape_latex )))}
154 155 \renewcommand{\releasename}{((( resources.sphinx.release | escape_latex )))}
155 156
156 157 % TODO: Add option for the user to specify a logo for his/her export.
157 158 \newcommand{\sphinxlogo}{}
158 159
159 160 % Make the index page of the document.
160 161 \makeindex
161 162
162 163 % Import sphinx document type specifics.
163 164 ((* block sphinxheader *))((* endblock sphinxheader *))
164 165 ((* endblock header *))
165 166
166 167 %==============================================================================
167 168 % Body
168 169 %==============================================================================
169 170 ((* block body *))
170 171 ((* block bodyBegin *))
171 172 % Body
172 173
173 174 % Start of the document
174 175 \begin{document}
175 176
176 177 ((* if resources.sphinx.header *))
177 178 \maketitle
178 179 ((* endif *))
179 180
180 181 ((* block toc *))
181 182 \tableofcontents
182 183 ((* endblock toc *))
183 184
184 ((* endblock bodyBegin *))((( super() )))((* block bodyEnd *))
185 ((* endblock bodyBegin *))
186 ((( super() )))
187 ((* block bodyEnd *))
185 188
186 189 \renewcommand{\indexname}{Index}
187 190 \printindex
188 191
189 192 % End of document
190 193 \end{document}
191 194 ((* endblock bodyEnd *))
192 195 ((* endblock body *))
193 196
194 197 %==============================================================================
195 198 % Footer
196 199 %==============================================================================
197 200 ((* block footer *))
198 201 ((* endblock footer *))
199 202
200 203 %==============================================================================
201 204 % Headings
202 205 %
203 206 % Purpose: Format pynb headers as sphinx headers. Depending on the Sphinx
204 207 % style that is active, this will change. Thus sphinx styles will
205 208 % override the values here.
206 209 %==============================================================================
207 210 ((* block headingcell -*))
208 211 \
209 212 ((*- if cell.level == 1 -*))
210 213 ((* block h1 -*))part((* endblock h1 -*))
211 214 ((*- elif cell.level == 2 -*))
212 215 ((* block h2 -*))chapter((* endblock h2 -*))
213 216 ((*- elif cell.level == 3 -*))
214 217 ((* block h3 -*))section((* endblock h3 -*))
215 218 ((*- elif cell.level == 4 -*))
216 219 ((* block h4 -*))subsection((* endblock h4 -*))
217 220 ((*- elif cell.level == 5 -*))
218 221 ((* block h5 -*))subsubsection((* endblock h5 -*))
219 222 ((*- elif cell.level == 6 -*))
220 223 ((* block h6 -*))paragraph((* endblock h6 -*))
221 224
222 225 ((= It's important to make sure that underscores (which tend to be common
223 226 in IPYNB file titles) do not make their way into latex. Sometimes this
224 227 causes latex to barf. =))
225 ((*- endif -*)){((( cell.source | markdown2latex )))}
228 ((*- endif -*))
229 {((( cell.source | markdown2latex )))}
226 230 ((*- endblock headingcell *))
227 231
228 232 %==============================================================================
229 233 % Markdown
230 234 %
231 235 % Purpose: Convert markdown to latex. Here markdown2latex is explicitly
232 236 % called since we know we want latex output.
233 237 %==============================================================================
234 238 ((*- block markdowncell scoped-*))
235 ((( cell.source | markdown2latex )))
239 ((( cell.source | markdown2latex )))
236 240 ((*- endblock markdowncell -*))
237 241
238 242 %==============================================================================
239 243 % Rawcell
240 244 %
241 245 % Purpose: Raw text cells allow the user to manually inject document code that
242 246 % will not get touched by the templating system.
243 247 %==============================================================================
244 248 ((*- block rawcell *))
245 ((( cell.source | wrap_text(wrap_size) )))
249 ((( cell.source | wrap_text(wrap_size) )))
246 250 ((* endblock rawcell -*))
247 251
248 252 %==============================================================================
249 253 % Unknowncell
250 254 %
251 255 % Purpose: This is the catch anything unhandled. To display this data, we
252 256 % remove all possible latex conflicts and wrap the characters so they
253 257 % can't flow off of the page.
254 258 %==============================================================================
255 259 ((* block unknowncell scoped*))
256
257 % Unsupported cell type, no formatting
258 ((( cell.source | wrap_text | escape_latex )))
260 % Unsupported cell type, no formatting
261 ((( cell.source | wrap_text | escape_latex )))
259 262 ((* endblock unknowncell *))
260 263
261 264 %==============================================================================
262 265 % Input
263 266 %==============================================================================
264 267 ((* block input *))
265 268
266 269 % Make sure that atleast 4 lines are below the HR
267 270 \needspace{((( min_header_lines )))\baselineskip}
268 271
269 272 ((* if resources.sphinx.outputstyle == 'simple' *))
270 273
271 274 % Add a horizantal break, along with break title.
272 275 \vspace{10pt}
273 276 {\scriptsize Input}\\*
274 277 \rule[10pt]{\linewidth}{0.5pt}
275 278 \vspace{-25pt}
276 279
277 280 % Add contents below.
278 281 ((( cell.input | highlight2latex )))
279 282
280 283 ((* elif resources.sphinx.outputstyle == 'notebook' *))
281 284 \vspace{6pt}
282 285 ((( write_prompt("In", cell.prompt_number, "nbframe-in-prompt") )))
283 286 \vspace{-2.65\baselineskip}
284 287 \begin{ColorVerbatim}
285 288 \vspace{-0.7\baselineskip}
286 289 ((( cell.input | highlight2latex )))
287 290 ((* if cell.input == None or cell.input == '' *))
288 291 \vspace{0.3\baselineskip}
289 292 ((* else *))
290 293 \vspace{-0.2\baselineskip}
291 294 ((* endif *))
292 295 \end{ColorVerbatim}
293 296 ((* endif *))
294 297 ((* endblock input *))
295 298
296 299 %==============================================================================
297 300 % Output_Group
298 301 %
299 302 % Purpose: Make sure that only one header bar only attaches to the output
300 303 % once. By keeping track of when an input group is started
301 304 %==============================================================================
302 305 ((* block output_group *))
303 306 ((* if cell.outputs.__len__() > 0 *))
304 307
305 308 % If the first block is an image, minipage the image. Else
306 309 % request a certain amount of space for the input text.
307 310 ((( iff_figure(cell.outputs[0], "\\begin{minipage}{1.0\\textwidth}", "\\needspace{" ~ min_header_lines ~ "\\baselineskip}") )))
308 311
309 312 ((* if resources.sphinx.outputstyle == 'simple' *))
310 313
311 314 % Add a horizantal break, along with break title.
312 315 \vspace{10pt}
313 316 {\scriptsize Output}\\*
314 317 \rule[10pt]{\linewidth}{0.5pt}
315 318 \vspace{-20pt}
316 319
317 320 % Add the contents of the first block.
318 321 ((( render_output(cell.outputs[0]) )))
319 322
320 323 % Close the minipage.
321 324 ((( iff_figure(cell.outputs[0], "\\end{minipage}", "") )))
322 325
323 326 % Add remainer of the document contents below.
324 327 ((* for output in cell.outputs[1:] *))
325 328 ((( render_output(output, cell.prompt_number) )))
326 329 ((* endfor *))
327 330 ((* elif resources.sphinx.outputstyle == 'notebook' *))
328 331
329 332 % Add document contents.
330 333 ((* for output in cell.outputs *))
331 334 ((( render_output(output, cell.prompt_number) )))
332 335 ((* endfor *))
333 336 ((* endif *))
334 337 ((* endif *))
335 338 ((* endblock *))
336 339
337 340 %==============================================================================
338 341 % Additional formating
339 342 %==============================================================================
340 343 ((* block data_text *))
341 ((( custom_verbatim(output.text) | ansi2latex)))
344 ((( custom_verbatim(output.text) | ansi2latex )))
342 345 ((* endblock *))
343 346
344 347 ((* block traceback_line *))
345 ((( conditionally_center_output(line | indent| strip_ansi) )))
348 ((( conditionally_center_output( line | indent| strip_ansi ) )))
346 349 ((* endblock traceback_line *))
347 350
348 351 %==============================================================================
349 352 % Supported image formats
350 353 %==============================================================================
351 354 ((*- block data_png -*))
352 ((( conditionally_center_output(insert_graphics(output.png_filename)) )))
355 ((( conditionally_center_output(insert_graphics(output.png_filename)) )))
353 356 ((*- endblock -*))
354 357
355 358 ((*- block data_jpg -*))
356 ((( conditionally_center_output(insert_graphics(output.jpg_filename)) )))
359 ((( conditionally_center_output(insert_graphics(output.jpg_filename)) )))
357 360 ((*- endblock -*))
358 361
359 362 ((*- block data_svg -*))
360 ((( conditionally_center_output(insert_graphics(output.svg_filename)) )))
363 ((( conditionally_center_output(insert_graphics(output.svg_filename)) )))
361 364 ((*- endblock -*))
362 365
363 366 ((*- block data_pdf -*))
364 ((( conditionally_center_output(insert_graphics(output.pdf_filename)) )))
367 ((( conditionally_center_output(insert_graphics(output.pdf_filename)) )))
365 368 ((*- endblock -*))
366 369
367 370 ((*- block data_latex *))
368 ((* if resources.sphinx.centeroutput *))\begin{center}((* endif -*))((( output.latex | strip_math_space )))((*- if resources.sphinx.centeroutput *))\end{center} ((* endif -*))
371 ((* if resources.sphinx.centeroutput *))
372 \begin{center}
373 ((* endif -*))
374 ((( output.latex | strip_math_space )))
375 ((*- if resources.sphinx.centeroutput *))
376 \end{center}
377 ((* endif -*))
369 378 ((*- endblock -*))
370 379
371 380 %==============================================================================
372 381 % Support Macros
373 382 %==============================================================================
374 383
375 384 % Name: write_prompt
376 385 % Purpose: Renders an output/input prompt for notebook style pdfs
377 386 ((* macro write_prompt(prompt, number, color) -*))
378 387 \makebox[0.1\linewidth]{\smaller\hfill\tt\color{((( color )))}((( prompt )))\hspace{4pt}{[}((( number ))){]}:\hspace{4pt}}\\*
379 388 ((*- endmacro *))
380 389
381 390 % Name: render_output
382 391 % Purpose: Renders an output block appropriately.
383 392 ((* macro render_output(output, prompt_number) -*))
384 393 ((*- if output.output_type == 'pyerr' -*))
385 394 ((*- block pyerr scoped *))
386 395 ((( custom_verbatim(super()) )))
387 396 ((* endblock pyerr -*))
388 397 ((*- else -*))
389 398
390 399 ((* if resources.sphinx.outputstyle == 'notebook' *))
391 400 ((*- if output.output_type == 'pyout' -*))
392 401 ((( write_prompt("Out", prompt_number, "nbframe-out-prompt") )))
393 402 \vspace{-2.55\baselineskip}
394 403 ((*- endif -*))
395 404
396 405 \begin{InvisibleVerbatim}
397 406 \vspace{-0.5\baselineskip}
398 407 ((*- endif -*))
399 408
400 409 ((*- block display_data scoped -*))
401 410 ((( super() )))
402 411 ((*- endblock display_data -*))
403 412
404 413 ((* if resources.sphinx.outputstyle == 'notebook' *))
405 414 \end{InvisibleVerbatim}
406 415 ((*- endif -*))
407 416 ((*- endif -*))
408 417 ((*- endmacro *))
409 418
410 419 % Name: iff_figure
411 420 % Purpose: If the output block provided is a figure type, the 'true_content'
412 421 % parameter will be returned. Else, the 'false_content'.
413 422 ((* macro iff_figure(output, true_content, false_content) -*))
414 423 ((*- set is_figure = false -*))
415 424 ((*- for type in output | filter_data_type -*))
416 425 ((*- if type in ['pdf', 'svg', 'png', 'jpeg','html']*))
417 426 ((*- set is_figure = true -*))
418 427 ((*- endif -*))
419 428 ((*- endfor -*))
420 429
421 430 ((* if is_figure -*))
422 431 ((( true_content )))
423 432 ((*- else -*))
424 433 ((( false_content )))
425 434 ((*- endif *))
426 435 ((*- endmacro *))
427 436
428 437 % Name: custom_verbatim
429 438 % Purpose: This macro creates a verbatim style block that fits the existing
430 439 % sphinx style more readily than standard verbatim blocks.
431 440 ((* macro custom_verbatim(text) -*))
432 441 \begin{alltt}
433 442 ((*- if resources.sphinx.centeroutput *))\begin{center} ((* endif -*))
434 443 ((( text | wrap_text(wrap_size) )))
435 444 ((*- if resources.sphinx.centeroutput *))\end{center}((* endif -*))
436 445 \end{alltt}
437 446 ((*- endmacro *))
438 447
439 448 % Name: conditionally_center_output
440 449 % Purpose: This macro centers the output if the output centering is enabled.
441 450 ((* macro conditionally_center_output(text) -*))
442 ((* if resources.sphinx.centeroutput *)){\centering ((* endif *))((( text )))((* if resources.sphinx.centeroutput *))}((* endif *))
451 ((* if resources.sphinx.centeroutput *))
452 {\centering
453 ((* endif *))
454 ((( text )))
455 ((* if resources.sphinx.centeroutput *))}
456 ((* endif *))
443 457 ((*- endmacro *))
444 458
445 459 % Name: insert_graphics
446 460 % Purpose: This macro will insert an image in the latex document given a path.
447 461 ((* macro insert_graphics(path) -*))
448 462 \begin{center}
449 \includegraphics[max size={\textwidth}{\textheight}]{(((path)))}
463 \includegraphics[max size={\textwidth}{\textheight}]{((( path )))}
450 464 \par
451 465 \end{center}
452 ((*- endmacro *))
466 ((*- endmacro *)) No newline at end of file
@@ -1,73 +1,74
1 1 {% extends 'display_priority.tpl' %}
2
3
2 4 {% block in_prompt %}
3 In[{{cell.prompt_number if cell.prompt_number else ' '}}]:{% endblock in_prompt %}
5 In[{{ cell.prompt_number if cell.prompt_number else ' ' }}]:
6 {% endblock in_prompt %}
4 7
5 {% block output_prompt %}{% if cell.haspyout %}Out[{{cell.prompt_number}}]:
6 {%- endif %}{%- endblock output_prompt %}
8 {% block output_prompt %}
9 {% if cell.haspyout %}
10 Out[{{ cell.prompt_number }}]:
11 {%- endif %}
12 {%- endblock output_prompt %}
7 13
8 14 {% block input %}
9 15 ```
10 {{ cell.input}}
16 {{ cell.input }}
11 17 ```
12 18 {% endblock input %}
13 19
14 20 {% block pyerr %}
15 21 {{ super() }}
16 22 {% endblock pyerr %}
17 23
18 24 {% block traceback_line %}
19 {{ line |indent| strip_ansi }}{% endblock traceback_line %}
25 {{ line | indent | strip_ansi }}
26 {% endblock traceback_line %}
20 27
21 28 {% block pyout %}
22 {% block data_priority scoped %}{{ super()}}{% endblock %}
29 {% block data_priority scoped %}
30 {{ super() }}
31 {% endblock %}
23 32 {% endblock pyout %}
24 33
25 34 {% block stream %}
26 {{ output.text| indent }}
35 {{ output.text | indent }}
27 36 {% endblock stream %}
28 37
29
30
31
32 38 {% block data_svg %}
33 [!image]({{output.svg_filename}})
39 [!image]({{ output.svg_filename }})
34 40 {% endblock data_svg %}
35 41
36 42 {% block data_png %}
37 [!image]({{output.png_filename}})
43 [!image]({{ output.png_filename }})
38 44 {% endblock data_png %}
39 45
40 46 {% block data_jpg %}
41 [!image]({{output.jpg_filename}})
47 [!image]({{ output.jpg_filename }})
42 48 {% endblock data_jpg %}
43 49
44
45
46 50 {% block data_latex %}
47 51 $$
48 {{output.latex}}
52 {{ output.latex }}
49 53 $$
50 54 {% endblock data_latex %}
51 55
52 56 {% block data_text scoped %}
53
54 {{output.text | indent}}
55
57 {{ output.text | indent }}
56 58 {% endblock data_text %}
57 59
58 60 {% block markdowncell scoped %}
59 {{ cell.source | wrap_text(80)}}
61 {{ cell.source | wrap_text(80) }}
60 62 {% endblock markdowncell %}
61 63
62 64 {% block headingcell scoped %}
63
64 65 {{ '#' * cell.level }} {{ cell.source | replace('\n', ' ') }}
65
66 66 {% endblock headingcell %}
67 67
68 {% block rawcell scoped %}{{ cell.source }}
68 {% block rawcell scoped %}
69 {{ cell.source }}
69 70 {% endblock rawcell %}
70 71
71 72 {% block unknowncell scoped %}
72 unknown type {{cell.type}}
73 {% endblock unknowncell %}
73 unknown type {{ cell.type }}
74 {% endblock unknowncell %} No newline at end of file
@@ -1,56 +1,55
1 1 {%- extends 'null.tpl' -%}
2 2
3
3 4 {% block in_prompt %}
4 # In[{{cell.prompt_number if cell.prompt_number else ' '}}]:
5 # In[{{ cell.prompt_number if cell.prompt_number else ' ' }}]:
5 6 {% endblock in_prompt %}
6 7
7 8 {% block output_prompt %}
8 # Out[{{cell.prompt_number}}]:{% endblock output_prompt %}
9 # Out[{{ cell.prompt_number }}]:
10 {% endblock output_prompt %}
9 11
10 {% block input %}{{ cell.input | ipython2python }}
12 {% block input %}
13 {{ cell.input | ipython2python }}
11 14 {% endblock input %}
12 15
13
14 16 {# Those Two are for error displaying
15 17 even if the first one seem to do nothing,
16 18 it introduces a new line
17
18 19 #}
19 {% block pyerr %}{{ super() }}
20 {% block pyerr %}
21 {{ super() }}
20 22 {% endblock pyerr %}
21 23
22 24 {% block traceback_line %}
23 {{ line |indent| strip_ansi }}{% endblock traceback_line %}
25 {{ line | indent | strip_ansi }}
26 {% endblock traceback_line %}
24 27 {# .... #}
25 28
26
27 29 {% block pyout %}
28 {{ output.text| indent | comment_lines }}
30 {{ output.text | indent | comment_lines }}
29 31 {% endblock pyout %}
30 32
31 33 {% block stream %}
32 {{ output.text| indent | comment_lines }}
34 {{ output.text | indent | comment_lines }}
33 35 {% endblock stream %}
34 36
35
36
37
38 37 {% block display_data scoped %}
39 38 # image file:
40 39 {% endblock display_data %}
41 40
42 41 {% block markdowncell scoped %}
43 42 {{ cell.source | comment_lines }}
44 43 {% endblock markdowncell %}
45 44
46 45 {% block headingcell scoped %}
47 46 {{ '#' * cell.level }}{{ cell.source | replace('\n', ' ') | comment_lines }}
48 47 {% endblock headingcell %}
49 48
50 49 {% block rawcell scoped %}
51 50 {{ cell.source | comment_lines }}
52 51 {% endblock rawcell %}
53 52
54 53 {% block unknowncell scoped %}
55 unknown type {{cell.type}}
56 {% endblock unknowncell %}
54 unknown type {{ cell.type }}
55 {% endblock unknowncell %} No newline at end of file
@@ -1,17 +1,16
1 1 {%- extends 'reveal_internals/reveal_cells.tpl' -%}
2 2
3 3
4
5 4 {%- block any_cell scoped -%}
6 5 {%- if cell.metadata.align_type in ['Left'] -%}
7 6 {{ super() }}
8 7 {%- elif cell.metadata.align_type in ['center'] -%}
9 8 <div style="text-align:center">
10 9 {{ super() }}
11 10 </div>
12 11 {%- elif cell.metadata.align_type in ['right'] -%}
13 12 <div style="text-align:right">
14 13 {{ super() }}
15 14 </div>
16 15 {%- endif -%}
17 16 {%- endblock any_cell -%}
@@ -1,21 +1,19
1 1 {%- extends 'html_basic.tpl' -%}
2 2
3
4
5 3 {%- block any_cell scoped -%}
6 4 {%- if cell.metadata.slide_type in ['-', 'slide', 'subslide'] -%}
7 5 {{ super() }}
8 6 {%- elif cell.metadata.slide_type in ['skip'] -%}
9 7 <div style=display:none>
10 8 {{ super() }}
11 9 </div>
12 10 {%- elif cell.metadata.slide_type in ['notes'] -%}
13 11 <aside class="notes">
14 12 {{ super() }}
15 13 </aside>
16 14 {%- elif cell.metadata.slide_type in ['fragment'] -%}
17 15 <div class="fragment">
18 16 {{ super() }}
19 17 </div>
20 18 {%- endif -%}
21 19 {%- endblock any_cell -%}
@@ -1,17 +1,16
1 1 {%- extends 'reveal_internals/subslides.tpl' -%}
2 2
3 3
4
5 4 {%- block any_cell scoped -%}
6 5 {%- if cell.metadata.slide_type in ['slide'] -%}
7 6 <section>
8 7 <section>
9 8 {%- endif -%}
10 9
11 {{ super() }}
10 {{ super() }}
12 11
13 12 {%- if cell.metadata.slide_helper in ['slide_end'] -%}
14 13 </section>
15 14 </section>
16 15 {%- endif -%}
17 16 {%- endblock any_cell -%}
@@ -1,15 +1,14
1 1 {%- extends 'reveal_internals/align_reveal_cells.tpl' -%}
2 2
3 3
4
5 4 {%- block any_cell scoped -%}
6 5 {%- if cell.metadata.slide_type in ['subslide'] -%}
7 6 <section>
8 7 {%- endif -%}
9 8
10 {{ super() }}
9 {{ super() }}
11 10
12 11 {%- if cell.metadata.slide_helper in ['subslide_end'] -%}
13 12 </section>
14 13 {%- endif -%}
15 14 {%- endblock any_cell -%}
@@ -1,75 +1,76
1 1 {%- extends 'display_priority.tpl' -%}
2 {% block in_prompt -%}
3 In[{{cell.prompt_number if cell.prompt_number else ' '}}]:
4 2
5 .. code:: python
6 3
4 {% block in_prompt -%}
5 In[{{ cell.prompt_number if cell.prompt_number else ' ' }}]:
6 .. code:: python
7 7 {% endblock in_prompt %}
8 8
9 {% block output_prompt %}{% if cell.haspyout -%}
10 Out[{{cell.prompt_number}}]:{% endif %}{% endblock output_prompt %}
11
12 {% block input %}{{ cell.input | indent}}
9 {% block output_prompt %}
10 {% if cell.haspyout -%}
11 Out[{{ cell.prompt_number }}]:
12 {% endif %}
13 {% endblock output_prompt %}
13 14
15 {% block input %}
16 {{ cell.input | indent}}
14 17 {% endblock input %}
15 18
16 {% block pyerr %}::
19 {% block pyerr %}
20 ::
17 21 {{ super() }}
18 22 {% endblock pyerr %}
19 23
20 24 {% block traceback_line %}
21 {{ line |indent| strip_ansi }}{% endblock traceback_line %}
25 {{ line | indent | strip_ansi }}
26 {% endblock traceback_line %}
22 27
23 28 {% block pyout %}
24 {% block data_priority scoped %}{{ super()}}{% endblock %}
29 {% block data_priority scoped %}
30 {{ super() }}
31 {% endblock %}
25 32 {% endblock pyout %}
26 33
27 34 {% block stream %}
28 35 .. parsed-literal::
29 36
30 {{ output.text| indent }}
37 {{ output.text | indent }}
31 38 {% endblock stream %}
32 39
33
34
35
36 {% block data_svg %}.. image:: {{output.svg_filename}}
37
40 {% block data_svg %}
41 .. image:: {{ output.svg_filename }}
38 42 {% endblock data_svg %}
39 43
40 {% block data_png %}.. image:: {{output.png_filename}}
41
44 {% block data_png %}
45 .. image:: {{ output.png_filename }}
42 46 {% endblock data_png %}
43 47
44 {% block data_jpg %}..jpg image:: {{output.jpg_filename}}
45
48 {% block data_jpg %}
49 ..jpg image:: {{ output.jpg_filename }}
46 50 {% endblock data_jpg %}
47 51
48
49
50 {% block data_latex %}.. math::
51
52 {{output.latex| indent}}
53
52 {% block data_latex %}
53 .. math::
54 {{ output.latex | indent }}
54 55 {% endblock data_latex %}
55 56
56 {% block data_text scoped %}.. parsed-literal::
57
58 {{output.text | indent}}
59
57 {% block data_text scoped %}
58 .. parsed-literal::
59 {{ output.text | indent }}
60 60 {% endblock data_text %}
61 61
62 {% block markdowncell scoped %}{{ cell.source | markdown2rst }}
62 {% block markdowncell scoped %}
63 {{ cell.source | markdown2rst }}
63 64 {% endblock markdowncell %}
64 65
65 66 {% block headingcell scoped %}
66 67 {{ ("#" * cell.level + cell.source) | replace('\n', ' ') | markdown2rst }}
67
68 68 {% endblock headingcell %}
69 69
70 {% block rawcell scoped %}{{ cell.source }}
70 {% block rawcell scoped %}
71 {{ cell.source }}
71 72 {% endblock rawcell %}
72 73
73 74 {% block unknowncell scoped %}
74 75 unknown type {{cell.type}}
75 {% endblock unknowncell %}
76 {% endblock unknowncell %} No newline at end of file
@@ -1,6 +1,6
1 1 ## Template skeleton
2 2
3 3 This contain skeleton template that you probably don't want
4 4 to inherit directly.
5 5
6 do not moify the content of the 'tex' folder which is generated by running 'make' in this folder.
6 do not modify the content of the 'tex' folder which is generated by running 'make' in this folder.
@@ -1,185 +1,185
1 1 {%- extends 'reveal_internals/slides.tpl' -%}
2 2
3 3
4 4 {% block header %}
5 5 <!DOCTYPE html>
6 6 <html>
7 7 <head>
8 8
9 9 <meta charset="utf-8" />
10 10 <meta http-equiv="X-UA-Compatible" content="chrome=1">
11 11
12 12 <meta name="apple-mobile-web-app-capable" content="yes" />
13 13 <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
14 14
15 15 <!-- General and theme style sheets -->
16 16 <link rel="stylesheet" href="{{resources.reveal.url_prefix}}/css/reveal.css">
17 17 <link rel="stylesheet" href="{{resources.reveal.url_prefix}}/css/theme/simple.css" id="theme">
18 18
19 19 <!-- For syntax highlighting -->
20 20 <link rel="stylesheet" href="{{resources.reveal.url_prefix}}/lib/css/zenburn.css">
21 21
22 22 <!-- If the query includes 'print-pdf', use the PDF print sheet -->
23 23 <script>
24 24 document.write( '<link rel="stylesheet" href="{{resources.reveal.url_prefix}}/css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
25 25 </script>
26 26
27 27 <!--[if lt IE 9]>
28 28 <script src="{{resources.reveal.url_prefix}}/lib/js/html5shiv.js"></script>
29 29 <![endif]-->
30 30
31 31 {% for css in resources.inlining.css -%}
32 <style type="text/css">
33 {{css}}
34 </style>
32 <style type="text/css">
33 {{ css }}
34 </style>
35 35 {% endfor %}
36 36
37 37 <style type="text/css">
38 38 /* Overrides of notebook CSS for static HTML export */
39 39 .reveal {
40 40 font-size: 20px;
41 41 overflow-y: auto;
42 42 overflow-x: hidden;
43 43 }
44 44 .reveal pre {
45 45 width: 95%;
46 46 padding: 0.4em;
47 47 margin: 0px;
48 48 font-family: monospace, sans-serif;
49 49 font-size: 80%;
50 50 box-shadow: 0px 0px 0px rgba(0, 0, 0, 0);
51 51 }
52 52 .reveal section img {
53 53 border: 0px solid black;
54 54 box-shadow: 0 0 10px rgba(0, 0, 0, 0);
55 55 }
56 56 .reveal .slides {
57 57 text-align: left;
58 58 }
59 59 .reveal.fade {
60 60 opacity: 1;
61 61 }
62 62 div.input_area {
63 63 padding: 0.06em;
64 64 }
65 65 div.code_cell {
66 66 background-color: transparent;
67 67 }
68 68 div.prompt {
69 69 width: 11ex;
70 70 padding: 0.4em;
71 71 margin: 0px;
72 72 font-family: monospace, sans-serif;
73 73 font-size: 80%;
74 74 text-align: right;
75 75 }
76 76 div.output_area pre {
77 77 font-family: monospace, sans-serif;
78 78 font-size: 80%;
79 79 }
80 80 div.output_prompt {
81 81 /* 5px right shift to account for margin in parent container */
82 82 margin: 5px 5px 0 0;
83 83 }
84 84 .rendered_html p {
85 85 text-align: inherit;
86 86 }
87 87 </style>
88 88
89 89 <!-- Custom stylesheet, it must be in the same directory as the html file -->
90 90 <link rel="stylesheet" href="custom.css">
91 91
92 92 </head>
93 93 {% endblock header%}
94 94
95 95
96 96 {% block body %}
97 97 <body>
98 <div class="reveal"><div class="slides">
99
98 <div class="reveal">
99 <div class="slides">
100 100 {{ super() }}
101
102 </div></div>
101 </div>
102 </div>
103 103
104 104 <!--
105 105 Uncomment the following block and the addthis_widget.js (see below inside dependencies)
106 106 to get enable social buttons.
107 107 -->
108 108
109 109 <!--
110 110 <div class="addthis_toolbox addthis_floating_style addthis_32x32_style" style="left:20px;top:20px;">
111 111 <a class="addthis_button_twitter"></a>
112 112 <a class="addthis_button_google_plusone_share"></a>
113 113 <a class="addthis_button_linkedin"></a>
114 114 <a class="addthis_button_facebook"></a>
115 115 <a class="addthis_button_more"></a>
116 116 </div>
117 117 -->
118 118
119 119 <script src="{{resources.reveal.url_prefix}}/lib/js/head.min.js"></script>
120 120
121 121 <script src="{{resources.reveal.url_prefix}}/js/reveal.js"></script>
122 122
123 123 <script>
124 124
125 125 // Full list of configuration options available here: https://github.com/hakimel/reveal.js#configuration
126 126 Reveal.initialize({
127 127 controls: true,
128 128 progress: true,
129 129 history: true,
130 130
131 131 theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
132 132 transition: Reveal.getQueryHash().transition || 'linear', // default/cube/page/concave/zoom/linear/none
133 133
134 134 // Optional libraries used to extend on reveal.js
135 135 dependencies: [
136 136 { src: "{{resources.reveal.url_prefix}}/lib/js/classList.js", condition: function() { return !document.body.classList; } },
137 137 { src: "{{resources.reveal.url_prefix}}/plugin/highlight/highlight.js", async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
138 138 { src: "{{resources.reveal.url_prefix}}/plugin/notes/notes.js", async: true, condition: function() { return !!document.body.classList; } }
139 139 // { src: 'http://s7.addthis.com/js/300/addthis_widget.js', async: true},
140 140 ]
141 141 });
142 142 </script>
143 143
144 144 <!-- MathJax configuration -->
145 145 <script type="text/x-mathjax-config">
146 146 MathJax.Hub.Config({
147 147 tex2jax: {
148 148 inlineMath: [ ['$','$'], ["\\(","\\)"] ],
149 149 displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
150 150 },
151 151 displayAlign: 'left', // Change this to 'center' to center equations.
152 152 "HTML-CSS": {
153 153 styles: {'.MathJax_Display': {"margin": 0}}
154 154 }
155 155 });
156 156 </script>
157 157 <!-- End of mathjax configuration -->
158 158
159 159 <script>
160 160 // We wait for the onload function to load MathJax after the page is completely loaded.
161 161 // MathJax is loaded 1 unit of time after the page is ready.
162 162 // This hack prevent problems when you load multiple js files (i.e. social button from addthis).
163 163 //
164 164 window.onload = function () {
165 165 setTimeout(function () {
166 166 var script = document.createElement("script");
167 167 script.type = "text/javascript";
168 168 script.src = "https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML";
169 169 document.getElementsByTagName("head")[0].appendChild(script);
170 170 },1)
171 171 }
172 172 </script>
173 173
174 174 <script>
175 175 Reveal.addEventListener( 'slidechanged', function( event ) {
176 176 MathJax.Hub.Rerender(event.currentSlide);
177 177 });
178 178 </script>
179 179
180 180 </body>
181 181 {% endblock body %}
182 182
183 183 {% block footer %}
184 184 </html>
185 185 {% endblock footer %}
General Comments 0
You need to be logged in to leave comments. Login now