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