Show More
@@ -1,202 +1,203 | |||||
1 | ((= Latex base template (must inherit) |
|
1 | ((= Latex base template (must inherit) | |
2 | This template builds upon the abstract template, adding common latex output |
|
2 | This template builds upon the abstract template, adding common latex output | |
3 | functions. Figures, data_text, |
|
3 | functions. Figures, data_text, | |
4 | This template does not define a docclass, the inheriting class must define this.=)) |
|
4 | This template does not define a docclass, the inheriting class must define this.=)) | |
5 |
|
5 | |||
6 | ((*- extends 'display_priority.tplx' -*)) |
|
6 | ((*- extends 'display_priority.tplx' -*)) | |
7 |
|
7 | |||
8 | %=============================================================================== |
|
8 | %=============================================================================== | |
9 | % Abstract overrides |
|
9 | % Abstract overrides | |
10 | %=============================================================================== |
|
10 | %=============================================================================== | |
11 |
|
11 | |||
12 | ((* block header *)) |
|
12 | ((* block header *)) | |
13 | ((* block docclass *))((* endblock docclass *)) |
|
13 | ((* block docclass *))((* endblock docclass *)) | |
14 |
|
14 | |||
15 | ((* block packages *)) |
|
15 | ((* block packages *)) | |
16 | \usepackage{graphicx} % Used to insert images |
|
16 | \usepackage{graphicx} % Used to insert images | |
17 | \usepackage{adjustbox} % Used to constrain images to a maximum size |
|
17 | \usepackage{adjustbox} % Used to constrain images to a maximum size | |
18 | \usepackage{color} % Allow colors to be defined |
|
18 | \usepackage{color} % Allow colors to be defined | |
19 | \usepackage{enumerate} % Needed for markdown enumerations to work |
|
19 | \usepackage{enumerate} % Needed for markdown enumerations to work | |
20 | \usepackage{geometry} % Used to adjust the document margins |
|
20 | \usepackage{geometry} % Used to adjust the document margins | |
21 | \usepackage{amsmath} % Equations |
|
21 | \usepackage{amsmath} % Equations | |
22 | \usepackage{amssymb} % Equations |
|
22 | \usepackage{amssymb} % Equations | |
|
23 | \usepackage{eurosym} % defines \euro | |||
23 | \usepackage[mathletters]{ucs} % Extended unicode (utf-8) support |
|
24 | \usepackage[mathletters]{ucs} % Extended unicode (utf-8) support | |
24 | \usepackage[utf8x]{inputenc} % Allow utf-8 characters in the tex document |
|
25 | \usepackage[utf8x]{inputenc} % Allow utf-8 characters in the tex document | |
25 | \usepackage{fancyvrb} % verbatim replacement that allows latex |
|
26 | \usepackage{fancyvrb} % verbatim replacement that allows latex | |
26 | \usepackage{grffile} % extends the file name processing of package graphics |
|
27 | \usepackage{grffile} % extends the file name processing of package graphics | |
27 | % to support a larger range |
|
28 | % to support a larger range | |
28 | % The hyperref package gives us a pdf with properly built |
|
29 | % The hyperref package gives us a pdf with properly built | |
29 | % internal navigation ('pdf bookmarks' for the table of contents, |
|
30 | % internal navigation ('pdf bookmarks' for the table of contents, | |
30 | % internal cross-reference links, web links for URLs, etc.) |
|
31 | % internal cross-reference links, web links for URLs, etc.) | |
31 | \usepackage{hyperref} |
|
32 | \usepackage{hyperref} | |
32 | \usepackage{longtable} % longtable support required by pandoc >1.10 |
|
33 | \usepackage{longtable} % longtable support required by pandoc >1.10 | |
33 | \usepackage{booktabs} % table support for pandoc > 1.12.2 |
|
34 | \usepackage{booktabs} % table support for pandoc > 1.12.2 | |
34 | ((* endblock packages *)) |
|
35 | ((* endblock packages *)) | |
35 |
|
36 | |||
36 | ((* block definitions *)) |
|
37 | ((* block definitions *)) | |
37 | \definecolor{orange}{cmyk}{0,0.4,0.8,0.2} |
|
38 | \definecolor{orange}{cmyk}{0,0.4,0.8,0.2} | |
38 | \definecolor{darkorange}{rgb}{.71,0.21,0.01} |
|
39 | \definecolor{darkorange}{rgb}{.71,0.21,0.01} | |
39 | \definecolor{darkgreen}{rgb}{.12,.54,.11} |
|
40 | \definecolor{darkgreen}{rgb}{.12,.54,.11} | |
40 | \definecolor{myteal}{rgb}{.26, .44, .56} |
|
41 | \definecolor{myteal}{rgb}{.26, .44, .56} | |
41 | \definecolor{gray}{gray}{0.45} |
|
42 | \definecolor{gray}{gray}{0.45} | |
42 | \definecolor{lightgray}{gray}{.95} |
|
43 | \definecolor{lightgray}{gray}{.95} | |
43 | \definecolor{mediumgray}{gray}{.8} |
|
44 | \definecolor{mediumgray}{gray}{.8} | |
44 | \definecolor{inputbackground}{rgb}{.95, .95, .85} |
|
45 | \definecolor{inputbackground}{rgb}{.95, .95, .85} | |
45 | \definecolor{outputbackground}{rgb}{.95, .95, .95} |
|
46 | \definecolor{outputbackground}{rgb}{.95, .95, .95} | |
46 | \definecolor{traceback}{rgb}{1, .95, .95} |
|
47 | \definecolor{traceback}{rgb}{1, .95, .95} | |
47 | % ansi colors |
|
48 | % ansi colors | |
48 | \definecolor{red}{rgb}{.6,0,0} |
|
49 | \definecolor{red}{rgb}{.6,0,0} | |
49 | \definecolor{green}{rgb}{0,.65,0} |
|
50 | \definecolor{green}{rgb}{0,.65,0} | |
50 | \definecolor{brown}{rgb}{0.6,0.6,0} |
|
51 | \definecolor{brown}{rgb}{0.6,0.6,0} | |
51 | \definecolor{blue}{rgb}{0,.145,.698} |
|
52 | \definecolor{blue}{rgb}{0,.145,.698} | |
52 | \definecolor{purple}{rgb}{.698,.145,.698} |
|
53 | \definecolor{purple}{rgb}{.698,.145,.698} | |
53 | \definecolor{cyan}{rgb}{0,.698,.698} |
|
54 | \definecolor{cyan}{rgb}{0,.698,.698} | |
54 | \definecolor{lightgray}{gray}{0.5} |
|
55 | \definecolor{lightgray}{gray}{0.5} | |
55 |
|
56 | |||
56 | % bright ansi colors |
|
57 | % bright ansi colors | |
57 | \definecolor{darkgray}{gray}{0.25} |
|
58 | \definecolor{darkgray}{gray}{0.25} | |
58 | \definecolor{lightred}{rgb}{1.0,0.39,0.28} |
|
59 | \definecolor{lightred}{rgb}{1.0,0.39,0.28} | |
59 | \definecolor{lightgreen}{rgb}{0.48,0.99,0.0} |
|
60 | \definecolor{lightgreen}{rgb}{0.48,0.99,0.0} | |
60 | \definecolor{lightblue}{rgb}{0.53,0.81,0.92} |
|
61 | \definecolor{lightblue}{rgb}{0.53,0.81,0.92} | |
61 | \definecolor{lightpurple}{rgb}{0.87,0.63,0.87} |
|
62 | \definecolor{lightpurple}{rgb}{0.87,0.63,0.87} | |
62 | \definecolor{lightcyan}{rgb}{0.5,1.0,0.83} |
|
63 | \definecolor{lightcyan}{rgb}{0.5,1.0,0.83} | |
63 |
|
64 | |||
64 | % commands and environments needed by pandoc snippets |
|
65 | % commands and environments needed by pandoc snippets | |
65 | % extracted from the output of `pandoc -s` |
|
66 | % extracted from the output of `pandoc -s` | |
66 | \DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}} |
|
67 | \DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}} | |
67 | % Add ',fontsize=\small' for more characters per line |
|
68 | % Add ',fontsize=\small' for more characters per line | |
68 | \newenvironment{Shaded}{}{} |
|
69 | \newenvironment{Shaded}{}{} | |
69 | \newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}} |
|
70 | \newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}} | |
70 | \newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}} |
|
71 | \newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}} | |
71 | \newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} |
|
72 | \newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} | |
72 | \newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} |
|
73 | \newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} | |
73 | \newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} |
|
74 | \newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} | |
74 | \newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} |
|
75 | \newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} | |
75 | \newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} |
|
76 | \newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} | |
76 | \newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}} |
|
77 | \newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}} | |
77 | \newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}} |
|
78 | \newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}} | |
78 | \newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} |
|
79 | \newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} | |
79 | \newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}} |
|
80 | \newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}} | |
80 | \newcommand{\RegionMarkerTok}[1]{{#1}} |
|
81 | \newcommand{\RegionMarkerTok}[1]{{#1}} | |
81 | \newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} |
|
82 | \newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} | |
82 | \newcommand{\NormalTok}[1]{{#1}} |
|
83 | \newcommand{\NormalTok}[1]{{#1}} | |
83 |
|
84 | |||
84 | % Define a nice break command that doesn't care if a line doesn't already |
|
85 | % Define a nice break command that doesn't care if a line doesn't already | |
85 | % exist. |
|
86 | % exist. | |
86 | \def\br{\hspace*{\fill} \\* } |
|
87 | \def\br{\hspace*{\fill} \\* } | |
87 | % Math Jax compatability definitions |
|
88 | % Math Jax compatability definitions | |
88 | \def\gt{>} |
|
89 | \def\gt{>} | |
89 | \def\lt{<} |
|
90 | \def\lt{<} | |
90 | % Document parameters |
|
91 | % Document parameters | |
91 | ((* block title *))\title{((( resources.metadata.name | ascii_only | escape_latex )))}((* endblock title *)) |
|
92 | ((* block title *))\title{((( resources.metadata.name | ascii_only | escape_latex )))}((* endblock title *)) | |
92 | ((* block date *))((* endblock date *)) |
|
93 | ((* block date *))((* endblock date *)) | |
93 | ((* block author *))((* endblock author *)) |
|
94 | ((* block author *))((* endblock author *)) | |
94 | ((* endblock definitions *)) |
|
95 | ((* endblock definitions *)) | |
95 |
|
96 | |||
96 | ((* block commands *)) |
|
97 | ((* block commands *)) | |
97 | % Prevent overflowing lines due to hard-to-break entities |
|
98 | % Prevent overflowing lines due to hard-to-break entities | |
98 | \sloppy |
|
99 | \sloppy | |
99 | % Setup hyperref package |
|
100 | % Setup hyperref package | |
100 | \hypersetup{ |
|
101 | \hypersetup{ | |
101 | breaklinks=true, % so long urls are correctly broken across lines |
|
102 | breaklinks=true, % so long urls are correctly broken across lines | |
102 | colorlinks=true, |
|
103 | colorlinks=true, | |
103 | urlcolor=blue, |
|
104 | urlcolor=blue, | |
104 | linkcolor=darkorange, |
|
105 | linkcolor=darkorange, | |
105 | citecolor=darkgreen, |
|
106 | citecolor=darkgreen, | |
106 | } |
|
107 | } | |
107 | % Slightly bigger margins than the latex defaults |
|
108 | % Slightly bigger margins than the latex defaults | |
108 | ((* block margins *)) |
|
109 | ((* block margins *)) | |
109 | \geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in} |
|
110 | \geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in} | |
110 | ((* endblock margins *)) |
|
111 | ((* endblock margins *)) | |
111 | ((* endblock commands *)) |
|
112 | ((* endblock commands *)) | |
112 | ((* endblock header *)) |
|
113 | ((* endblock header *)) | |
113 |
|
114 | |||
114 | ((* block body *)) |
|
115 | ((* block body *)) | |
115 | \begin{document} |
|
116 | \begin{document} | |
116 |
|
117 | |||
117 | ((* block predoc *)) |
|
118 | ((* block predoc *)) | |
118 | ((* block maketitle *))\maketitle((* endblock maketitle *)) |
|
119 | ((* block maketitle *))\maketitle((* endblock maketitle *)) | |
119 | ((* block abstract *))((* endblock abstract *)) |
|
120 | ((* block abstract *))((* endblock abstract *)) | |
120 | ((* endblock predoc *)) |
|
121 | ((* endblock predoc *)) | |
121 |
|
122 | |||
122 | ((( super() ))) |
|
123 | ((( super() ))) | |
123 |
|
124 | |||
124 | % Add a bibliography block to the postdoc |
|
125 | % Add a bibliography block to the postdoc | |
125 | ((* block postdoc *)) |
|
126 | ((* block postdoc *)) | |
126 | ((* block bibliography *))((* endblock bibliography *)) |
|
127 | ((* block bibliography *))((* endblock bibliography *)) | |
127 | ((* endblock postdoc *)) |
|
128 | ((* endblock postdoc *)) | |
128 | \end{document} |
|
129 | \end{document} | |
129 | ((* endblock body *)) |
|
130 | ((* endblock body *)) | |
130 |
|
131 | |||
131 | %=============================================================================== |
|
132 | %=============================================================================== | |
132 | % Support blocks |
|
133 | % Support blocks | |
133 | %=============================================================================== |
|
134 | %=============================================================================== | |
134 |
|
135 | |||
135 | % Displaying simple data text |
|
136 | % Displaying simple data text | |
136 | ((* block data_text *)) |
|
137 | ((* block data_text *)) | |
137 | \begin{verbatim} |
|
138 | \begin{verbatim} | |
138 | ((( output.data['text/plain'] ))) |
|
139 | ((( output.data['text/plain'] ))) | |
139 | \end{verbatim} |
|
140 | \end{verbatim} | |
140 | ((* endblock data_text *)) |
|
141 | ((* endblock data_text *)) | |
141 |
|
142 | |||
142 | % Display python error text as-is |
|
143 | % Display python error text as-is | |
143 | ((* block error *)) |
|
144 | ((* block error *)) | |
144 | \begin{Verbatim}[commandchars=\\\{\}] |
|
145 | \begin{Verbatim}[commandchars=\\\{\}] | |
145 | ((( super() ))) |
|
146 | ((( super() ))) | |
146 | \end{Verbatim} |
|
147 | \end{Verbatim} | |
147 | ((* endblock error *)) |
|
148 | ((* endblock error *)) | |
148 | ((* block traceback_line *)) |
|
149 | ((* block traceback_line *)) | |
149 | ((( line | indent | strip_ansi | escape_latex ))) |
|
150 | ((( line | indent | strip_ansi | escape_latex ))) | |
150 | ((* endblock traceback_line *)) |
|
151 | ((* endblock traceback_line *)) | |
151 |
|
152 | |||
152 | % Display stream ouput with coloring |
|
153 | % Display stream ouput with coloring | |
153 | ((* block stream *)) |
|
154 | ((* block stream *)) | |
154 | \begin{Verbatim}[commandchars=\\\{\}] |
|
155 | \begin{Verbatim}[commandchars=\\\{\}] | |
155 | ((( output.text | escape_latex | ansi2latex ))) |
|
156 | ((( output.text | escape_latex | ansi2latex ))) | |
156 | \end{Verbatim} |
|
157 | \end{Verbatim} | |
157 | ((* endblock stream *)) |
|
158 | ((* endblock stream *)) | |
158 |
|
159 | |||
159 | % Display latex |
|
160 | % Display latex | |
160 | ((* block data_latex -*)) |
|
161 | ((* block data_latex -*)) | |
161 | ((*- if output.data['text/latex'].startswith('$'): -*)) |
|
162 | ((*- if output.data['text/latex'].startswith('$'): -*)) | |
162 | ((= Replace $ symbols with more explicit, equation block. =)) |
|
163 | ((= Replace $ symbols with more explicit, equation block. =)) | |
163 | \begin{equation*}\adjustbox{max width=\hsize}{$ |
|
164 | \begin{equation*}\adjustbox{max width=\hsize}{$ | |
164 | ((( output.data['text/latex'] | strip_dollars ))) |
|
165 | ((( output.data['text/latex'] | strip_dollars ))) | |
165 | $}\end{equation*} |
|
166 | $}\end{equation*} | |
166 | ((*- else -*)) |
|
167 | ((*- else -*)) | |
167 | ((( output.data['text/latex'] ))) |
|
168 | ((( output.data['text/latex'] ))) | |
168 | ((*- endif *)) |
|
169 | ((*- endif *)) | |
169 | ((* endblock data_latex *)) |
|
170 | ((* endblock data_latex *)) | |
170 |
|
171 | |||
171 | % Default mechanism for rendering figures |
|
172 | % Default mechanism for rendering figures | |
172 | ((*- block data_png -*))((( draw_figure(output.metadata.filenames['image/png']) )))((*- endblock -*)) |
|
173 | ((*- block data_png -*))((( draw_figure(output.metadata.filenames['image/png']) )))((*- endblock -*)) | |
173 | ((*- block data_jpg -*))((( draw_figure(output.metadata.filenames['image/jpeg']) )))((*- endblock -*)) |
|
174 | ((*- block data_jpg -*))((( draw_figure(output.metadata.filenames['image/jpeg']) )))((*- endblock -*)) | |
174 | ((*- block data_svg -*))((( draw_figure(output.metadata.filenames['image/svg+xml']) )))((*- endblock -*)) |
|
175 | ((*- block data_svg -*))((( draw_figure(output.metadata.filenames['image/svg+xml']) )))((*- endblock -*)) | |
175 | ((*- block data_pdf -*))((( draw_figure(output.metadata.filenames['application/pdf']) )))((*- endblock -*)) |
|
176 | ((*- block data_pdf -*))((( draw_figure(output.metadata.filenames['application/pdf']) )))((*- endblock -*)) | |
176 |
|
177 | |||
177 | % Draw a figure using the graphicx package. |
|
178 | % Draw a figure using the graphicx package. | |
178 | ((* macro draw_figure(filename) -*)) |
|
179 | ((* macro draw_figure(filename) -*)) | |
179 | ((* set filename = filename | posix_path *)) |
|
180 | ((* set filename = filename | posix_path *)) | |
180 | ((*- block figure scoped -*)) |
|
181 | ((*- block figure scoped -*)) | |
181 | \begin{center} |
|
182 | \begin{center} | |
182 | \adjustimage{max size={0.9\linewidth}{0.9\paperheight}}{((( filename )))} |
|
183 | \adjustimage{max size={0.9\linewidth}{0.9\paperheight}}{((( filename )))} | |
183 | \end{center} |
|
184 | \end{center} | |
184 | { \hspace*{\fill} \\} |
|
185 | { \hspace*{\fill} \\} | |
185 | ((*- endblock figure -*)) |
|
186 | ((*- endblock figure -*)) | |
186 | ((*- endmacro *)) |
|
187 | ((*- endmacro *)) | |
187 |
|
188 | |||
188 | % Redirect execute_result to display data priority. |
|
189 | % Redirect execute_result to display data priority. | |
189 | ((* block execute_result scoped *)) |
|
190 | ((* block execute_result scoped *)) | |
190 | ((* block data_priority scoped *)) |
|
191 | ((* block data_priority scoped *)) | |
191 | ((( super() ))) |
|
192 | ((( super() ))) | |
192 | ((* endblock *)) |
|
193 | ((* endblock *)) | |
193 | ((* endblock execute_result *)) |
|
194 | ((* endblock execute_result *)) | |
194 |
|
195 | |||
195 | % Render markdown |
|
196 | % Render markdown | |
196 | ((* block markdowncell scoped *)) |
|
197 | ((* block markdowncell scoped *)) | |
197 | ((( cell.source | citation2latex | strip_files_prefix | markdown2latex ))) |
|
198 | ((( cell.source | citation2latex | strip_files_prefix | markdown2latex ))) | |
198 | ((* endblock markdowncell *)) |
|
199 | ((* endblock markdowncell *)) | |
199 |
|
200 | |||
200 | % Don't display unknown types |
|
201 | % Don't display unknown types | |
201 | ((* block unknowncell scoped *)) |
|
202 | ((* block unknowncell scoped *)) | |
202 | ((* endblock unknowncell *)) |
|
203 | ((* endblock unknowncell *)) |
General Comments 0
You need to be logged in to leave comments.
Login now