Show More
@@ -1,269 +1,270 b'' | |||
|
1 | 1 | ((*- extends 'display_priority.tplx' -*)) |
|
2 | 2 | |
|
3 | 3 | |
|
4 | 4 | \nonstopmode |
|
5 | 5 | |
|
6 | 6 | ((* block in_prompt *)) |
|
7 | 7 | ((* endblock in_prompt *)) |
|
8 | 8 | |
|
9 | 9 | ((* block output_prompt *)) |
|
10 | 10 | ((* endblock output_prompt *)) |
|
11 | 11 | |
|
12 | 12 | ((* block codecell *)) |
|
13 | 13 | \begin{codecell} |
|
14 | 14 | ((( super() ))) |
|
15 | 15 | \end{codecell} |
|
16 | 16 | ((* endblock *)) |
|
17 | 17 | |
|
18 | 18 | ((* block input *)) |
|
19 | 19 | \begin{codeinput} |
|
20 | 20 | \begin{lstlisting} |
|
21 | 21 | ((( cell.input ))) |
|
22 | 22 | \end{lstlisting} |
|
23 | 23 | \end{codeinput} |
|
24 | 24 | ((* endblock input *)) |
|
25 | 25 | |
|
26 | 26 | ((= Those Two are for error displaying |
|
27 | 27 | even if the first one seem to do nothing, |
|
28 | 28 | it introduces a new line |
|
29 | 29 | =)) |
|
30 | 30 | |
|
31 | 31 | ((* block pyerr *)) |
|
32 | 32 | \begin{traceback} |
|
33 | 33 | \begin{verbatim} |
|
34 | 34 | ((( super() ))) |
|
35 | 35 | \end{verbatim} |
|
36 | 36 | \end{traceback} |
|
37 | 37 | ((* endblock pyerr *)) |
|
38 | 38 | |
|
39 | 39 | ((* block traceback_line *)) |
|
40 | 40 | ((( line | indent | strip_ansi ))) |
|
41 | 41 | ((* endblock traceback_line *)) |
|
42 | 42 | ((= .... =)) |
|
43 | 43 | |
|
44 | 44 | ((*- block output_group -*)) |
|
45 | 45 | \begin{codeoutput} |
|
46 | 46 | ((( super() ))) |
|
47 | 47 | \end{codeoutput} |
|
48 | 48 | ((* endblock *)) |
|
49 | 49 | |
|
50 | 50 | ((*- block data_png -*)) |
|
51 | 51 | \begin{center} |
|
52 | 52 | \includegraphics[max size={0.7\textwidth}{0.9\textheight}]{((( output.png_filename | posix_path )))} |
|
53 | 53 | \par |
|
54 | 54 | \end{center} |
|
55 | 55 | ((*- endblock -*)) |
|
56 | 56 | |
|
57 | 57 | ((*- block data_jpg -*)) |
|
58 | 58 | \begin{center} |
|
59 | 59 | \includegraphics[max size={0.7\textwidth}{0.9\textheight}]{((( output.jpeg_filename | posix_path )))} |
|
60 | 60 | \par |
|
61 | 61 | \end{center} |
|
62 | 62 | ((*- endblock -*)) |
|
63 | 63 | |
|
64 | 64 | ((*- block data_svg -*)) |
|
65 | 65 | \begin{center} |
|
66 | 66 | \includegraphics[width=0.7\textwidth]{((( output.svg_filename | posix_path )))} |
|
67 | 67 | \par |
|
68 | 68 | \end{center} |
|
69 | 69 | ((*- endblock -*)) |
|
70 | 70 | |
|
71 | 71 | ((*- block data_pdf -*)) |
|
72 | 72 | \begin{center} |
|
73 | 73 | \includegraphics[width=0.7\textwidth]{((( output.pdf_filename | posix_path )))} |
|
74 | 74 | \par |
|
75 | 75 | \end{center} |
|
76 | 76 | ((*- endblock -*)) |
|
77 | 77 | |
|
78 | 78 | ((* block pyout *)) |
|
79 | 79 | ((* block data_priority scoped *)) |
|
80 | 80 | ((( super() ))) |
|
81 | 81 | ((* endblock *)) |
|
82 | 82 | ((* endblock pyout *)) |
|
83 | 83 | |
|
84 | 84 | ((* block data_text *)) |
|
85 | 85 | \begin{verbatim} |
|
86 | 86 | ((( output.text ))) |
|
87 | 87 | \end{verbatim} |
|
88 | 88 | ((* endblock *)) |
|
89 | 89 | |
|
90 | 90 | ((* block data_latex -*)) |
|
91 | 91 | ((*- if output.latex.startswith('$'): -*)) \begin{equation*} |
|
92 | 92 | ((( output.latex | strip_dollars ))) |
|
93 | 93 | \end{equation*} |
|
94 | 94 | ((*- else -*)) |
|
95 | 95 | ((( output.latex ))) |
|
96 | 96 | ((*- endif *)) |
|
97 | 97 | ((* endblock *)) |
|
98 | 98 | |
|
99 | 99 | ((* block stream *)) |
|
100 | 100 | \begin{Verbatim}[commandchars=\\\{\}] |
|
101 | 101 | ((( output.text | ansi2latex ))) |
|
102 | 102 | \end{Verbatim} |
|
103 | 103 | ((* endblock stream *)) |
|
104 | 104 | |
|
105 | 105 | ((* block markdowncell scoped *)) |
|
106 | 106 | ((( cell.source | markdown2latex ))) |
|
107 | 107 | ((* endblock markdowncell *)) |
|
108 | 108 | |
|
109 | 109 | ((* block headingcell scoped -*)) |
|
110 | 110 | ((( ('#' * cell.level + cell.source) | replace('\n', ' ') | markdown2latex ))) |
|
111 | 111 | ((* endblock headingcell *)) |
|
112 | 112 | |
|
113 | 113 | ((* block rawcell scoped *)) |
|
114 | 114 | ((( cell.source | comment_lines ))) |
|
115 | 115 | ((* endblock rawcell *)) |
|
116 | 116 | |
|
117 | 117 | ((* block unknowncell scoped *)) |
|
118 | 118 | unknown type ((( cell.type ))) |
|
119 | 119 | ((* endblock unknowncell *)) |
|
120 | 120 | |
|
121 | 121 | ((* block body *)) |
|
122 | 122 | |
|
123 | 123 | ((* block bodyBegin *)) |
|
124 | 124 | \begin{document} |
|
125 | 125 | ((* endblock bodyBegin *)) |
|
126 | 126 | |
|
127 | 127 | ((( super() ))) |
|
128 | 128 | |
|
129 | 129 | ((* block bodyEnd *)) |
|
130 | 130 | \end{document} |
|
131 | 131 | ((* endblock bodyEnd *)) |
|
132 | 132 | ((* endblock body *)) |
|
133 | 133 | |
|
134 | 134 | ((* block header *)) |
|
135 | 135 | %% This file was auto-generated by IPython. |
|
136 | 136 | %% Conversion from the original notebook file: |
|
137 | 137 | %% |
|
138 | 138 | \documentclass[11pt,english]{article} |
|
139 | 139 | |
|
140 | 140 | %% This is the automatic preamble used by IPython. Note that it does *not* |
|
141 | 141 | %% include a documentclass declaration, that is added at runtime to the overall |
|
142 | 142 | %% document. |
|
143 | 143 | |
|
144 | 144 | \usepackage{amsmath} |
|
145 | 145 | \usepackage{amssymb} |
|
146 | 146 | \usepackage{graphicx} |
|
147 | \usepackage{grffile} | |
|
147 | 148 | \usepackage{ucs} |
|
148 | 149 | \usepackage[utf8x]{inputenc} |
|
149 | 150 | |
|
150 | 151 | % Scale down larger images |
|
151 | 152 | \usepackage[export]{adjustbox} |
|
152 | 153 | |
|
153 | 154 | %fancy verbatim |
|
154 | 155 | \usepackage{fancyvrb} |
|
155 | 156 | % needed for markdown enumerations to work |
|
156 | 157 | \usepackage{enumerate} |
|
157 | 158 | |
|
158 | 159 | % Slightly bigger margins than the latex defaults |
|
159 | 160 | \usepackage{geometry} |
|
160 | 161 | \geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=2.5cm,rmargin=2.5cm} |
|
161 | 162 | |
|
162 | 163 | % Define a few colors for use in code, links and cell shading |
|
163 | 164 | \usepackage{color} |
|
164 | 165 | \definecolor{orange}{cmyk}{0,0.4,0.8,0.2} |
|
165 | 166 | \definecolor{darkorange}{rgb}{.71,0.21,0.01} |
|
166 | 167 | \definecolor{darkgreen}{rgb}{.12,.54,.11} |
|
167 | 168 | \definecolor{myteal}{rgb}{.26, .44, .56} |
|
168 | 169 | \definecolor{gray}{gray}{0.45} |
|
169 | 170 | \definecolor{lightgray}{gray}{.95} |
|
170 | 171 | \definecolor{mediumgray}{gray}{.8} |
|
171 | 172 | \definecolor{inputbackground}{rgb}{.95, .95, .85} |
|
172 | 173 | \definecolor{outputbackground}{rgb}{.95, .95, .95} |
|
173 | 174 | \definecolor{traceback}{rgb}{1, .95, .95} |
|
174 | 175 | |
|
175 | 176 | % new ansi colors |
|
176 | 177 | \definecolor{brown}{rgb}{0.54,0.27,0.07} |
|
177 | 178 | \definecolor{purple}{rgb}{0.5,0.0,0.5} |
|
178 | 179 | \definecolor{darkgray}{gray}{0.25} |
|
179 | 180 | \definecolor{lightred}{rgb}{1.0,0.39,0.28} |
|
180 | 181 | \definecolor{lightgreen}{rgb}{0.48,0.99,0.0} |
|
181 | 182 | \definecolor{lightblue}{rgb}{0.53,0.81,0.92} |
|
182 | 183 | \definecolor{lightpurple}{rgb}{0.87,0.63,0.87} |
|
183 | 184 | \definecolor{lightcyan}{rgb}{0.5,1.0,0.83} |
|
184 | 185 | |
|
185 | 186 | % Framed environments for code cells (inputs, outputs, errors, ...). The |
|
186 | 187 | % various uses of \unskip (or not) at the end were fine-tuned by hand, so don't |
|
187 | 188 | % randomly change them unless you're sure of the effect it will have. |
|
188 | 189 | \usepackage{framed} |
|
189 | 190 | |
|
190 | 191 | % remove extraneous vertical space in boxes |
|
191 | 192 | \setlength\fboxsep{0pt} |
|
192 | 193 | |
|
193 | 194 | % codecell is the whole input+output set of blocks that a Code cell can |
|
194 | 195 | % generate. |
|
195 | 196 | |
|
196 | 197 | % TODO: unfortunately, it seems that using a framed codecell environment breaks |
|
197 | 198 | % the ability of the frames inside of it to be broken across pages. This |
|
198 | 199 | % causes at least the problem of having lots of empty space at the bottom of |
|
199 | 200 | % pages as new frames are moved to the next page, and if a single frame is too |
|
200 | 201 | % long to fit on a page, will completely stop latex from compiling the |
|
201 | 202 | % document. So unless we figure out a solution to this, we'll have to instead |
|
202 | 203 | % leave the codecell env. as empty. I'm keeping the original codecell |
|
203 | 204 | % definition here (a thin vertical bar) for reference, in case we find a |
|
204 | 205 | % solution to the page break issue. |
|
205 | 206 | |
|
206 | 207 | %% \newenvironment{codecell}{% |
|
207 | 208 | %% \def\FrameCommand{\color{mediumgray} \vrule width 1pt \hspace{5pt}}% |
|
208 | 209 | %% \MakeFramed{\vspace{-0.5em}}} |
|
209 | 210 | %% {\unskip\endMakeFramed} |
|
210 | 211 | |
|
211 | 212 | % For now, make this a no-op... |
|
212 | 213 | \newenvironment{codecell}{} |
|
213 | 214 | |
|
214 | 215 | \newenvironment{codeinput}{% |
|
215 | 216 | \def\FrameCommand{\colorbox{inputbackground}}% |
|
216 | 217 | \MakeFramed{\advance\hsize-\width \FrameRestore}} |
|
217 | 218 | {\unskip\endMakeFramed} |
|
218 | 219 | |
|
219 | 220 | \newenvironment{codeoutput}{% |
|
220 | 221 | \def\FrameCommand{\colorbox{outputbackground}}% |
|
221 | 222 | \vspace{-1.4em} |
|
222 | 223 | \MakeFramed{\advance\hsize-\width \FrameRestore}} |
|
223 | 224 | {\unskip\medskip\endMakeFramed} |
|
224 | 225 | |
|
225 | 226 | \newenvironment{traceback}{% |
|
226 | 227 | \def\FrameCommand{\colorbox{traceback}}% |
|
227 | 228 | \MakeFramed{\advance\hsize-\width \FrameRestore}} |
|
228 | 229 | {\endMakeFramed} |
|
229 | 230 | |
|
230 | 231 | % Use and configure listings package for nicely formatted code |
|
231 | 232 | \usepackage{listingsutf8} |
|
232 | 233 | \lstset{ |
|
233 | 234 | language=python, |
|
234 | 235 | inputencoding=utf8x, |
|
235 | 236 | extendedchars=\true, |
|
236 | 237 | aboveskip=\smallskipamount, |
|
237 | 238 | belowskip=\smallskipamount, |
|
238 | 239 | xleftmargin=2mm, |
|
239 | 240 | breaklines=true, |
|
240 | 241 | basicstyle=\small \ttfamily, |
|
241 | 242 | showstringspaces=false, |
|
242 | 243 | keywordstyle=\color{blue}\bfseries, |
|
243 | 244 | commentstyle=\color{myteal}, |
|
244 | 245 | stringstyle=\color{darkgreen}, |
|
245 | 246 | identifierstyle=\color{darkorange}, |
|
246 | 247 | columns=fullflexible, % tighter character kerning, like verb |
|
247 | 248 | } |
|
248 | 249 | |
|
249 | 250 | % The hyperref package gives us a pdf with properly built |
|
250 | 251 | % internal navigation ('pdf bookmarks' for the table of contents, |
|
251 | 252 | % internal cross-reference links, web links for URLs, etc.) |
|
252 | 253 | \usepackage{hyperref} |
|
253 | 254 | \hypersetup{ |
|
254 | 255 | breaklinks=true, % so long urls are correctly broken across lines |
|
255 | 256 | colorlinks=true, |
|
256 | 257 | urlcolor=blue, |
|
257 | 258 | linkcolor=darkorange, |
|
258 | 259 | citecolor=darkgreen, |
|
259 | 260 | } |
|
260 | 261 | |
|
261 | 262 | % hardcode size of all verbatim environments to be a bit smaller |
|
262 | 263 | \makeatletter |
|
263 | 264 | \g@addto@macro\@verbatim\small\topsep=0.5em\partopsep=0pt |
|
264 | 265 | \makeatother |
|
265 | 266 | |
|
266 | 267 | % Prevent overflowing lines due to urls and other hard-to-break entities. |
|
267 | 268 | \sloppy |
|
268 | 269 | |
|
269 | 270 | ((* endblock *)) |
General Comments 0
You need to be logged in to leave comments.
Login now