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