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