|
@@
-1,193
+1,197
|
|
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 'abstract.tplx' -*))
|
|
6
|
((*- extends 'display_priority.tplx' -*))
|
|
7
|
|
|
7
|
|
|
8
|
%===============================================================================
|
|
8
|
%===============================================================================
|
|
9
|
% Abstract overrides
|
|
9
|
% Abstract overrides
|
|
10
|
%===============================================================================
|
|
10
|
%===============================================================================
|
|
11
|
|
|
11
|
|
|
|
|
|
12
|
((* block header *))
|
|
|
|
|
13
|
((* block docclass *))((* endblock docclass *))
|
|
|
|
|
14
|
|
|
12
|
((* block packages *))
|
|
15
|
((* block packages *))
|
|
13
|
\usepackage{graphicx} % Used to insert images
|
|
16
|
\usepackage{graphicx} % Used to insert images
|
|
14
|
\usepackage{adjustbox} % Used to constrain images to a maximum size
|
|
17
|
\usepackage{adjustbox} % Used to constrain images to a maximum size
|
|
15
|
\usepackage{color} % Allow colors to be defined
|
|
18
|
\usepackage{color} % Allow colors to be defined
|
|
16
|
\usepackage{enumerate} % Needed for markdown enumerations to work
|
|
19
|
\usepackage{enumerate} % Needed for markdown enumerations to work
|
|
17
|
\usepackage{geometry} % Used to adjust the document margins
|
|
20
|
\usepackage{geometry} % Used to adjust the document margins
|
|
18
|
\usepackage{amsmath} % Equations
|
|
21
|
\usepackage{amsmath} % Equations
|
|
19
|
\usepackage{amssymb} % Equations
|
|
22
|
\usepackage{amssymb} % Equations
|
|
20
|
\usepackage[utf8]{inputenc} % Allow utf-8 characters in the tex document
|
|
23
|
\usepackage[utf8]{inputenc} % Allow utf-8 characters in the tex document
|
|
21
|
\usepackage{ucs} % Extended unicode (utf-8) support
|
|
24
|
\usepackage{ucs} % Extended unicode (utf-8) support
|
|
22
|
\usepackage{fancyvrb} % verbatim replacement that allows latex
|
|
25
|
\usepackage{fancyvrb} % verbatim replacement that allows latex
|
|
23
|
\usepackage{grffile} % extends the file name processing of package graphics
|
|
26
|
\usepackage{grffile} % extends the file name processing of package graphics
|
|
24
|
%to support a larger range
|
|
27
|
% to support a larger range
|
|
25
|
|
|
|
|
|
26
|
% The hyperref package gives us a pdf with properly built
|
|
28
|
% The hyperref package gives us a pdf with properly built
|
|
27
|
% internal navigation ('pdf bookmarks' for the table of contents,
|
|
29
|
% internal navigation ('pdf bookmarks' for the table of contents,
|
|
28
|
% internal cross-reference links, web links for URLs, etc.)
|
|
30
|
% internal cross-reference links, web links for URLs, etc.)
|
|
29
|
\usepackage{hyperref}
|
|
31
|
\usepackage{hyperref}
|
|
30
|
((* endblock packages *))
|
|
32
|
((* endblock packages *))
|
|
31
|
|
|
33
|
|
|
32
|
((* block definitions *))
|
|
34
|
((* block definitions *))
|
|
33
|
|
|
|
|
|
34
|
\definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
|
|
35
|
\definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
|
|
35
|
\definecolor{darkorange}{rgb}{.71,0.21,0.01}
|
|
36
|
\definecolor{darkorange}{rgb}{.71,0.21,0.01}
|
|
36
|
\definecolor{darkgreen}{rgb}{.12,.54,.11}
|
|
37
|
\definecolor{darkgreen}{rgb}{.12,.54,.11}
|
|
37
|
\definecolor{myteal}{rgb}{.26, .44, .56}
|
|
38
|
\definecolor{myteal}{rgb}{.26, .44, .56}
|
|
38
|
\definecolor{gray}{gray}{0.45}
|
|
39
|
\definecolor{gray}{gray}{0.45}
|
|
39
|
\definecolor{lightgray}{gray}{.95}
|
|
40
|
\definecolor{lightgray}{gray}{.95}
|
|
40
|
\definecolor{mediumgray}{gray}{.8}
|
|
41
|
\definecolor{mediumgray}{gray}{.8}
|
|
41
|
\definecolor{inputbackground}{rgb}{.95, .95, .85}
|
|
42
|
\definecolor{inputbackground}{rgb}{.95, .95, .85}
|
|
42
|
\definecolor{outputbackground}{rgb}{.95, .95, .95}
|
|
43
|
\definecolor{outputbackground}{rgb}{.95, .95, .95}
|
|
43
|
\definecolor{traceback}{rgb}{1, .95, .95}
|
|
44
|
\definecolor{traceback}{rgb}{1, .95, .95}
|
|
44
|
|
|
|
|
|
45
|
% new ansi colors
|
|
45
|
% new ansi colors
|
|
46
|
\definecolor{brown}{rgb}{0.54,0.27,0.07}
|
|
46
|
\definecolor{brown}{rgb}{0.54,0.27,0.07}
|
|
47
|
\definecolor{purple}{rgb}{0.5,0.0,0.5}
|
|
47
|
\definecolor{purple}{rgb}{0.5,0.0,0.5}
|
|
48
|
\definecolor{darkgray}{gray}{0.25}
|
|
48
|
\definecolor{darkgray}{gray}{0.25}
|
|
49
|
\definecolor{lightred}{rgb}{1.0,0.39,0.28}
|
|
49
|
\definecolor{lightred}{rgb}{1.0,0.39,0.28}
|
|
50
|
\definecolor{lightgreen}{rgb}{0.48,0.99,0.0}
|
|
50
|
\definecolor{lightgreen}{rgb}{0.48,0.99,0.0}
|
|
51
|
\definecolor{lightblue}{rgb}{0.53,0.81,0.92}
|
|
51
|
\definecolor{lightblue}{rgb}{0.53,0.81,0.92}
|
|
52
|
\definecolor{lightpurple}{rgb}{0.87,0.63,0.87}
|
|
52
|
\definecolor{lightpurple}{rgb}{0.87,0.63,0.87}
|
|
53
|
\definecolor{lightcyan}{rgb}{0.5,1.0,0.83}
|
|
53
|
\definecolor{lightcyan}{rgb}{0.5,1.0,0.83}
|
|
54
|
|
|
|
|
|
55
|
% Define a nice break command that doesn't care if a line doesn't already
|
|
54
|
% Define a nice break command that doesn't care if a line doesn't already
|
|
56
|
% exist.
|
|
55
|
% exist.
|
|
57
|
\def\br{\hspace*{\fill} \\* }
|
|
56
|
\def\br{\hspace*{\fill} \\* }
|
|
58
|
|
|
|
|
|
59
|
% Math Jax compatability definitions
|
|
57
|
% Math Jax compatability definitions
|
|
60
|
\def\gt{>}
|
|
58
|
\def\gt{>}
|
|
61
|
\def\lt{<}
|
|
59
|
\def\lt{<}
|
|
62
|
|
|
|
|
|
63
|
% Document parameters
|
|
60
|
% Document parameters
|
|
64
|
((* block title *))\title{((( resources.metadata.name | escape_latex )))}((* endblock title *))
|
|
61
|
((* block title *))\title{((( resources.metadata.name | escape_latex )))}((* endblock title *))
|
|
65
|
((* block date *))((* endblock date *))
|
|
62
|
((* block date *))((* endblock date *))
|
|
66
|
((* block author *))((* endblock author *))
|
|
63
|
((* block author *))((* endblock author *))
|
|
67
|
((* endblock definitions *))
|
|
64
|
((* endblock definitions *))
|
|
68
|
|
|
65
|
|
|
69
|
((* block commands *))
|
|
66
|
((* block commands *))
|
|
70
|
\sloppy % Prevent overflowing lines due to hard-to-break entities
|
|
67
|
% Prevent overflowing lines due to hard-to-break entities
|
|
71
|
|
|
68
|
\sloppy
|
|
72
|
% Setup hyperref package
|
|
69
|
% Setup hyperref package
|
|
73
|
\hypersetup{
|
|
70
|
\hypersetup{
|
|
74
|
breaklinks=true, % so long urls are correctly broken across lines
|
|
71
|
breaklinks=true, % so long urls are correctly broken across lines
|
|
75
|
colorlinks=true,
|
|
72
|
colorlinks=true,
|
|
76
|
urlcolor=blue,
|
|
73
|
urlcolor=blue,
|
|
77
|
linkcolor=darkorange,
|
|
74
|
linkcolor=darkorange,
|
|
78
|
citecolor=darkgreen,
|
|
75
|
citecolor=darkgreen,
|
|
79
|
}
|
|
76
|
}
|
|
80
|
|
|
|
|
|
81
|
% Slightly bigger margins than the latex defaults
|
|
77
|
% Slightly bigger margins than the latex defaults
|
|
82
|
((* block margins *))
|
|
78
|
((* block margins *))
|
|
83
|
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}
|
|
79
|
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}
|
|
84
|
((* endblock margins *))
|
|
80
|
((* endblock margins *))
|
|
85
|
((* endblock commands *))
|
|
81
|
((* endblock commands *))
|
|
|
|
|
82
|
((* endblock header *))
|
|
|
|
|
83
|
|
|
|
|
|
84
|
((* block body *))
|
|
|
|
|
85
|
\begin{document}
|
|
86
|
|
|
86
|
|
|
87
|
((* block predoc *))
|
|
87
|
((* block predoc *))
|
|
88
|
((* block maketitle *))\maketitle((* endblock maketitle *))
|
|
88
|
((* block maketitle *))\maketitle((* endblock maketitle *))
|
|
89
|
((* block abstract *))((* endblock abstract *))
|
|
89
|
((* block abstract *))((* endblock abstract *))
|
|
90
|
((* endblock predoc *))
|
|
90
|
((* endblock predoc *))
|
|
91
|
|
|
91
|
|
|
|
|
|
92
|
((( super() )))
|
|
|
|
|
93
|
|
|
|
|
|
94
|
% Add a bibliography block to the postdoc
|
|
|
|
|
95
|
((* block postdoc *))
|
|
|
|
|
96
|
((* block bibliography *))((* endblock bibliography *))
|
|
|
|
|
97
|
((* endblock postdoc *))
|
|
|
|
|
98
|
\end{document}
|
|
|
|
|
99
|
((* endblock body *))
|
|
|
|
|
100
|
|
|
92
|
%===============================================================================
|
|
101
|
%===============================================================================
|
|
93
|
% Support blocks
|
|
102
|
% Support blocks
|
|
94
|
%===============================================================================
|
|
103
|
%===============================================================================
|
|
95
|
|
|
104
|
|
|
96
|
% Displaying simple data text
|
|
105
|
% Displaying simple data text
|
|
97
|
((* block data_text *))
|
|
106
|
((* block data_text *))
|
|
98
|
\begin{verbatim}
|
|
107
|
\begin{verbatim}
|
|
99
|
((( output.text )))
|
|
108
|
((( output.text )))
|
|
100
|
\end{verbatim}
|
|
109
|
\end{verbatim}
|
|
101
|
((* endblock data_text *))
|
|
110
|
((* endblock data_text *))
|
|
102
|
|
|
111
|
|
|
103
|
% Display python error text as-is
|
|
112
|
% Display python error text as-is
|
|
104
|
((* block pyerr *))
|
|
113
|
((* block pyerr *))
|
|
105
|
\begin{Verbatim}[commandchars=\\\{\}]
|
|
114
|
\begin{Verbatim}[commandchars=\\\{\}]
|
|
106
|
((( super() )))
|
|
115
|
((( super() )))
|
|
107
|
\end{Verbatim}
|
|
116
|
\end{Verbatim}
|
|
108
|
((* endblock pyerr *))
|
|
117
|
((* endblock pyerr *))
|
|
109
|
((* block traceback_line *))
|
|
118
|
((* block traceback_line *))
|
|
110
|
((( line | indent | strip_ansi | escape_latex )))
|
|
119
|
((( line | indent | strip_ansi | escape_latex )))
|
|
111
|
((* endblock traceback_line *))
|
|
120
|
((* endblock traceback_line *))
|
|
112
|
|
|
121
|
|
|
113
|
% Display stream ouput with coloring
|
|
122
|
% Display stream ouput with coloring
|
|
114
|
((* block stream *))
|
|
123
|
((* block stream *))
|
|
115
|
\begin{Verbatim}[commandchars=\\\{\}]
|
|
124
|
\begin{Verbatim}[commandchars=\\\{\}]
|
|
116
|
((( output.text | escape_latex | ansi2latex )))
|
|
125
|
((( output.text | escape_latex | ansi2latex )))
|
|
117
|
\end{Verbatim}
|
|
126
|
\end{Verbatim}
|
|
118
|
((* endblock stream *))
|
|
127
|
((* endblock stream *))
|
|
119
|
|
|
128
|
|
|
120
|
% Display latex
|
|
129
|
% Display latex
|
|
121
|
((* block data_latex -*))
|
|
130
|
((* block data_latex -*))
|
|
122
|
((*- if output.latex.startswith('$'): -*))
|
|
131
|
((*- if output.latex.startswith('$'): -*))
|
|
123
|
((= Replace $ symbols with more explicit, equation block. =))
|
|
132
|
((= Replace $ symbols with more explicit, equation block. =))
|
|
124
|
\begin{equation*}
|
|
133
|
\begin{equation*}
|
|
125
|
((( output.latex | strip_dollars )))
|
|
134
|
((( output.latex | strip_dollars )))
|
|
126
|
\end{equation*}
|
|
135
|
\end{equation*}
|
|
127
|
((*- else -*))
|
|
136
|
((*- else -*))
|
|
128
|
((( output.latex )))
|
|
137
|
((( output.latex )))
|
|
129
|
((*- endif *))
|
|
138
|
((*- endif *))
|
|
130
|
((* endblock data_latex *))
|
|
139
|
((* endblock data_latex *))
|
|
131
|
|
|
140
|
|
|
132
|
% Default mechanism for rendering figures
|
|
141
|
% Default mechanism for rendering figures
|
|
133
|
((*- block data_png -*))((( draw_figure(output.png_filename) )))((*- endblock -*))
|
|
142
|
((*- block data_png -*))((( draw_figure(output.png_filename) )))((*- endblock -*))
|
|
134
|
((*- block data_jpg -*))((( draw_figure(output.jpeg_filename) )))((*- endblock -*))
|
|
143
|
((*- block data_jpg -*))((( draw_figure(output.jpeg_filename) )))((*- endblock -*))
|
|
135
|
((*- block data_svg -*))((( draw_figure(output.svg_filename) )))((*- endblock -*))
|
|
144
|
((*- block data_svg -*))((( draw_figure(output.svg_filename) )))((*- endblock -*))
|
|
136
|
((*- block data_pdf -*))((( draw_figure(output.pdf_filename) )))((*- endblock -*))
|
|
145
|
((*- block data_pdf -*))((( draw_figure(output.pdf_filename) )))((*- endblock -*))
|
|
137
|
|
|
146
|
|
|
138
|
% Draw a figure using the graphicx package.
|
|
147
|
% Draw a figure using the graphicx package.
|
|
139
|
((* macro draw_figure(filename) -*))
|
|
148
|
((* macro draw_figure(filename) -*))
|
|
140
|
((* set filename = filename | posix_path *))
|
|
149
|
((* set filename = filename | posix_path *))
|
|
141
|
((*- block figure scoped -*))
|
|
150
|
((*- block figure scoped -*))
|
|
142
|
\begin{center}
|
|
151
|
\begin{center}
|
|
143
|
\adjustimage{max size={0.9\linewidth}{0.9\paperheight}}{((( filename )))}
|
|
152
|
\adjustimage{max size={0.9\linewidth}{0.9\paperheight}}{((( filename )))}
|
|
144
|
\end{center}
|
|
153
|
\end{center}
|
|
145
|
{ \hspace*{\fill} \\}
|
|
154
|
{ \hspace*{\fill} \\}
|
|
146
|
((*- endblock figure -*))
|
|
155
|
((*- endblock figure -*))
|
|
147
|
((*- endmacro *))
|
|
156
|
((*- endmacro *))
|
|
148
|
|
|
157
|
|
|
149
|
% Draw heading cell. Explicitly map different cell levels.
|
|
158
|
% Draw heading cell. Explicitly map different cell levels.
|
|
150
|
((* block headingcell scoped *))
|
|
159
|
((* block headingcell scoped *))
|
|
151
|
|
|
160
|
|
|
152
|
((* if cell.level == 1 -*))
|
|
161
|
((* if cell.level == 1 -*))
|
|
153
|
((* block h1 -*))\section((* endblock h1 -*))
|
|
162
|
((* block h1 -*))\section((* endblock h1 -*))
|
|
154
|
((* elif cell.level == 2 -*))
|
|
163
|
((* elif cell.level == 2 -*))
|
|
155
|
((* block h2 -*))\subsection((* endblock h2 -*))
|
|
164
|
((* block h2 -*))\subsection((* endblock h2 -*))
|
|
156
|
((* elif cell.level == 3 -*))
|
|
165
|
((* elif cell.level == 3 -*))
|
|
157
|
((* block h3 -*))\subsubsection((* endblock h3 -*))
|
|
166
|
((* block h3 -*))\subsubsection((* endblock h3 -*))
|
|
158
|
((* elif cell.level == 4 -*))
|
|
167
|
((* elif cell.level == 4 -*))
|
|
159
|
((* block h4 -*))\paragraph((* endblock h4 -*))
|
|
168
|
((* block h4 -*))\paragraph((* endblock h4 -*))
|
|
160
|
((* elif cell.level == 5 -*))
|
|
169
|
((* elif cell.level == 5 -*))
|
|
161
|
((* block h5 -*))\subparagraph((* endblock h5 -*))
|
|
170
|
((* block h5 -*))\subparagraph((* endblock h5 -*))
|
|
162
|
((* elif cell.level == 6 -*))
|
|
171
|
((* elif cell.level == 6 -*))
|
|
163
|
((* block h6 -*))\\*\textit((* endblock h6 -*))
|
|
172
|
((* block h6 -*))\\*\textit((* endblock h6 -*))
|
|
164
|
((*- endif -*))
|
|
173
|
((*- endif -*))
|
|
165
|
{((( cell.source | replace('\n', ' ') | citation2latex | markdown2latex )))}
|
|
174
|
{((( cell.source | replace('\n', ' ') | citation2latex | markdown2latex )))}
|
|
166
|
|
|
175
|
|
|
167
|
((* endblock headingcell *))
|
|
176
|
((* endblock headingcell *))
|
|
168
|
|
|
177
|
|
|
169
|
% Redirect pyout to display data priority.
|
|
178
|
% Redirect pyout to display data priority.
|
|
170
|
((* block pyout scoped *))
|
|
179
|
((* block pyout scoped *))
|
|
171
|
((* block data_priority scoped *))
|
|
180
|
((* block data_priority scoped *))
|
|
172
|
((( super() )))
|
|
181
|
((( super() )))
|
|
173
|
((* endblock *))
|
|
182
|
((* endblock *))
|
|
174
|
((* endblock pyout *))
|
|
183
|
((* endblock pyout *))
|
|
175
|
|
|
184
|
|
|
176
|
% Render markdown
|
|
185
|
% Render markdown
|
|
177
|
((* block markdowncell scoped *))
|
|
186
|
((* block markdowncell scoped *))
|
|
178
|
((( cell.source | citation2latex | markdown2latex )))
|
|
187
|
((( cell.source | citation2latex | markdown2latex )))
|
|
179
|
((* endblock markdowncell *))
|
|
188
|
((* endblock markdowncell *))
|
|
180
|
|
|
189
|
|
|
181
|
% Spit out the contents of raw cells unmodified
|
|
190
|
% Spit out the contents of raw cells unmodified
|
|
182
|
((* block rawcell scoped *))
|
|
191
|
((* block rawcell scoped *))
|
|
183
|
((( cell.source )))
|
|
192
|
((( cell.source )))
|
|
184
|
((* endblock rawcell *))
|
|
193
|
((* endblock rawcell *))
|
|
185
|
|
|
194
|
|
|
186
|
% Don't display unknown types
|
|
195
|
% Don't display unknown types
|
|
187
|
((* block unknowncell scoped *))
|
|
196
|
((* block unknowncell scoped *))
|
|
188
|
((* endblock unknowncell *))
|
|
197
|
((* endblock unknowncell *))
|
|
189
|
|
|
|
|
|
190
|
% Add a bibliography block to the postdoc
|
|
|
|
|
191
|
((* block postdoc *))
|
|
|
|
|
192
|
((* block bibliography *))((* endblock bibliography *))
|
|
|
|
|
193
|
((* endblock postdoc *))
No newline at end of file
|
|
|
|