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