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