git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #3879 from adunning/patch-1

Combine LaTeX/Beamer templates

commit91240d08b7f3315d160f4f2628ba7d558734a690 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 8 Sep 2017, 10:43 (9 years ago) parent7320054331a0a0
2 files changed+106−15
MANUAL.txt+4−12 data/templates/default.latex+102−3
MANUAL.txt+4−12
@@ -196,7 +196,7 @@ are available: [`amsfonts`], [`amsmath`], [`lm`], [`unicode-math`],
196196[`ifxetex`], [`ifluatex`], [`eurosym`], [`listings`] (if the
197197`--listings` option is used), [`fancyvrb`], [`longtable`],
198198[`booktabs`], [`graphicx`] and [`grffile`] (if the document
199−contains images), [`hyperref`], [`ulem`], [`geometry`] (with the
199+contains images), [`hyperref`], [`xcolor`] (with `colorlinks`), [`ulem`], [`geometry`] (with the
200200`geometry` variable set), [`setspace`] (with `linestretch`), and
201201[`babel`] (with `lang`). The use of `xelatex` or `lualatex` as
202202the LaTeX engine requires [`fontspec`]. `xelatex` uses
@@ -1350,14 +1350,6 @@ including all [reveal.js configuration options].
13501350: when true, the `beamerarticle` package is loaded (for
13511351 producing an article from beamer slides).
13521352
1353−`colorlinks`
1354−: add color to link text; automatically enabled if any of `linkcolor`, `citecolor`,
1355− `urlcolor`, or `toccolor` are set (for beamer only).
1356−
1357−`linkcolor`, `citecolor`, `urlcolor`, `toccolor`
1358−: color for internal links, citation links, external links, and links in table
1359− of contents: uses any of the [predefined LaTeX colors] (for beamer only).
1360−
13611353`aspectratio`
13621354: aspect ratio of slides (for beamer only, `1610` for 16:10, `169` for 16:9,
13631355 `149` for 14:9, `141` for 1.41:1, `54` for 5:4, `43` for 4:3 which is the
@@ -1430,7 +1422,7 @@ LaTeX variables are used when [creating a PDF].
14301422
14311423`linkcolor`, `citecolor`, `urlcolor`, `toccolor`
14321424: color for internal links, citation links, external links, and links in table of contents:
1433− uses any of the [predefined LaTeX colors]
1425+ uses options allowed by [`xcolor`], including the `dvipsnames`, `svgnames`, and `x11names` lists
14341426
14351427`links-as-notes`
14361428: causes links to be printed as footnotes
@@ -1478,7 +1470,7 @@ LaTeX variables are used when [creating a PDF].
14781470[`book`]: https://ctan.org/pkg/book
14791471[KOMA-Script]: https://ctan.org/pkg/koma-script
14801472[`memoir`]: https://ctan.org/pkg/memoir
1481−[predefined LaTeX colors]: https://en.wikibooks.org/wiki/LaTeX/Colors#Predefined_colors
1473+[`xcolor`]: https://ctan.org/pkg/xcolor
14821474[LaTeX Font Catalogue]: http://www.tug.dk/FontCatalogue/
14831475[`mathpazo`]: https://ctan.org/pkg/mathpazo
14841476[LaTeX font encodings]: https://ctan.org/pkg/encguide
@@ -4326,7 +4318,7 @@ Hubert Plociniczak,
43264318Ilya V. Portnov,
43274319Ivo Clarysse,
43284320J. Lewis Muir,
4329−Jaime Marquínez Ferrándiz,
4321+Jaime Marquínez Ferrándiz,
43304322Jakob Voß,
43314323James Aspnes,
43324324Jamie F. Olson,
data/templates/default.latex+102−3
@@ -1,10 +1,16 @@
11\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
22\PassOptionsToPackage{hyphens}{url}
33$if(colorlinks)$
4−\PassOptionsToPackage{usenames,dvipsnames}{color}
4+\PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor}
55$endif$
66%
7−\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
7+\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$if(beamer)$ignorenonframetext,$if(handout)$handout,$endif$$if(aspectratio)$aspectratio=$aspectratio$,$endif$$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
8+$if(beamer)$
9+\setbeamertemplate{caption}[numbered]
10+\setbeamertemplate{caption label separator}{: }
11+\setbeamercolor{caption name}{fg=normal text.fg}
12+\beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$
13+$endif$
814$if(beamerarticle)$
915\usepackage{beamerarticle} % needs to be loaded first
1016$endif$
@@ -81,6 +87,26 @@ $if(CJKmainfont)$
8187 \fi
8288$endif$
8389\fi
90+$if(beamer)$
91+$if(theme)$
92+\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
93+$endif$
94+$if(colortheme)$
95+\usecolortheme{$colortheme$}
96+$endif$
97+$if(fonttheme)$
98+\usefonttheme{$fonttheme$}
99+$endif$
100+$if(mainfont)$
101+\usefonttheme{serif} % use mainfont rather than sansfont for slide text
102+$endif$
103+$if(innertheme)$
104+\useinnertheme{$innertheme$}
105+$endif$
106+$if(outertheme)$
107+\useoutertheme{$outertheme$}
108+$endif$
109+$endif$
84110% use upquote if available, for straight quotes in verbatim environments
85111\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
86112% use microtype if available
@@ -100,6 +126,9 @@ $endif$
100126$if(verbatim-in-note)$
101127\usepackage{fancyvrb}
102128$endif$
129+$if(colorlinks)$
130+\usepackage{xcolor}
131+$endif$
103132\usepackage{hyperref}
104133\hypersetup{
105134$if(title-meta)$
@@ -127,6 +156,9 @@ $endif$
127156$if(geometry)$
128157\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
129158$endif$
159+$if(beamer)$
160+\newif\ifbibliography
161+$endif$
130162$if(natbib)$
131163\usepackage[$natbiboptions$]{natbib}
132164\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
@@ -151,6 +183,13 @@ $if(tables)$
151183\usepackage{longtable,booktabs}
152184% Fix footnotes in tables (requires footnote package)
153185\IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{longtable}}{}
186+$if(beamer)$
187+\usepackage{caption}
188+% These lines are needed to make table captions work with longtable:
189+\makeatletter
190+\def\fnum@table{\tablename~\thetable}
191+\makeatother
192+$endif$
154193$endif$
155194$if(graphics)$
156195\usepackage{graphicx,grffile}
@@ -163,6 +202,31 @@ $if(graphics)$
163202% using explicit options in \includegraphics[width, height, ...]{}
164203\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
165204$endif$
205+$if(beamer)$
206+% Prevent slide breaks in the middle of a paragraph:
207+\widowpenalties 1 10000
208+\raggedbottom
209+$if(section-titles)$
210+\AtBeginPart{
211+ \let\insertpartnumber\relax
212+ \let\partname\relax
213+ \frame{\partpage}
214+}
215+\AtBeginSection{
216+ \ifbibliography
217+ \else
218+ \let\insertsectionnumber\relax
219+ \let\sectionname\relax
220+ \frame{\sectionpage}
221+ \fi
222+}
223+\AtBeginSubsection{
224+ \let\insertsubsectionnumber\relax
225+ \let\subsectionname\relax
226+ \frame{\subsectionpage}
227+}
228+$endif$
229+$endif$
166230$if(links-as-notes)$
167231% Make links footnotes instead of hotlinks:
168232\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
@@ -180,6 +244,8 @@ $if(numbersections)$
180244$else$
181245\setcounter{secnumdepth}{0}
182246$endif$
247+$if(beamer)$
248+$else$
183249$if(subparagraph)$
184250$else$
185251% Redefines (sub)paragraphs to behave more like sections
@@ -192,6 +258,7 @@ $else$
192258\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
193259\fi
194260$endif$
261+$endif$
195262
196263% set default figure placement to htbp
197264\makeatletter
@@ -249,9 +316,20 @@ $if(institute)$
249316\institute{$for(institute)$$institute$$sep$ \and $endfor$}
250317$endif$
251318\date{$date$}
319+$if(beamer)$
320+$if(titlegraphic)$
321+\titlegraphic{\includegraphics{$titlegraphic$}}
322+$endif$
323+$if(logo)$
324+\logo{\includegraphics{$logo$}}
325+$endif$
326+$endif$
252327
253328\begin{document}
254329$if(title)$
330+$if(beamer)$
331+\frame{\titlepage}
332+$else$
255333\maketitle
256334$endif$
257335$if(abstract)$
@@ -259,20 +337,27 @@ $if(abstract)$
259337$abstract$
260338\end{abstract}
261339$endif$
340+$endif$
262341
263342$for(include-before)$
264343$include-before$
265344
266345$endfor$
267346$if(toc)$
347+$if(beamer)$
348+\begin{frame}
349+\tableofcontents[hideallsubsections]
350+\end{frame}
351+$else$
268352{
269353$if(colorlinks)$
270−\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
354+\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$}
271355$endif$
272356\setcounter{tocdepth}{$toc-depth$}
273357\tableofcontents
274358}
275359$endif$
360+$endif$
276361$if(lot)$
277362\listoftables
278363$endif$
@@ -290,12 +375,26 @@ $else$
290375\renewcommand\refname{$biblio-title$}
291376$endif$
292377$endif$
378+$if(beamer)$
379+\begin{frame}[allowframebreaks]{$biblio-title$}
380+\bibliographytrue
381+$endif$
293382\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
383+$if(beamer)$
384+\end{frame}
385+$endif$
294386
295387$endif$
296388$endif$
297389$if(biblatex)$
390+$if(beamer)$
391+\begin{frame}[allowframebreaks]{$biblio-title$}
392+\bibliographytrue
393+\printbibliography[heading=none]
394+\end{frame}
395+$else$
298396\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
397+$endif$
299398
300399$endif$
301400$for(include-after)$