git.iko.soy/typeable/pandoc
on master help sign in
Combine LaTeX/Beamer templates

All conditionals use the `beamer` variable set by the writer. Closes #3878.

commita89aa1a681cb65ef723d0d83b65d3a8ba4b1d94e authorAndrew Dunning <adunning@users.noreply.github.com> dateSat 26 Aug 2017, 09:37 (9 years ago) parent1b3431a
1 file changed+97−1
data/templates/default.latex+97−1
data/templates/default.latex+97−1
@@ -4,7 +4,13 @@ $if(colorlinks)$
44\PassOptionsToPackage{usenames,dvipsnames}{color}
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
@@ -127,6 +153,9 @@ $endif$
127153$if(geometry)$
128154\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
129155$endif$
156+$if(beamer)$
157+\newif\ifbibliography
158+$endif$
130159$if(natbib)$
131160\usepackage[$natbiboptions$]{natbib}
132161\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
@@ -151,6 +180,13 @@ $if(tables)$
151180\usepackage{longtable,booktabs}
152181% Fix footnotes in tables (requires footnote package)
153182\IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{longtable}}{}
183+$if(beamer)$
184+\usepackage{caption}
185+% These lines are needed to make table captions work with longtable:
186+\makeatletter
187+\def\fnum@table{\tablename~\thetable}
188+\makeatother
189+$endif$
154190$endif$
155191$if(graphics)$
156192\usepackage{graphicx,grffile}
@@ -163,6 +199,31 @@ $if(graphics)$
163199% using explicit options in \includegraphics[width, height, ...]{}
164200\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
165201$endif$
202+$if(beamer)$
203+% Prevent slide breaks in the middle of a paragraph:
204+\widowpenalties 1 10000
205+\raggedbottom
206+$if(section-titles)$
207+\AtBeginPart{
208+ \let\insertpartnumber\relax
209+ \let\partname\relax
210+ \frame{\partpage}
211+}
212+\AtBeginSection{
213+ \ifbibliography
214+ \else
215+ \let\insertsectionnumber\relax
216+ \let\sectionname\relax
217+ \frame{\sectionpage}
218+ \fi
219+}
220+\AtBeginSubsection{
221+ \let\insertsubsectionnumber\relax
222+ \let\subsectionname\relax
223+ \frame{\subsectionpage}
224+}
225+$endif$
226+$endif$
166227$if(links-as-notes)$
167228% Make links footnotes instead of hotlinks:
168229\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
@@ -180,6 +241,8 @@ $if(numbersections)$
180241$else$
181242\setcounter{secnumdepth}{0}
182243$endif$
244+$if(beamer)$
245+$else$
183246$if(subparagraph)$
184247$else$
185248% Redefines (sub)paragraphs to behave more like sections
@@ -192,6 +255,7 @@ $else$
192255\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
193256\fi
194257$endif$
258+$endif$
195259$if(lang)$
196260\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
197261 \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
@@ -249,9 +313,20 @@ $if(institute)$
249313\institute{$for(institute)$$institute$$sep$ \and $endfor$}
250314$endif$
251315\date{$date$}
316+$if(beamer)$
317+$if(titlegraphic)$
318+\titlegraphic{\includegraphics{$titlegraphic$}}
319+$endif$
320+$if(logo)$
321+\logo{\includegraphics{$logo$}}
322+$endif$
323+$endif$
252324
253325\begin{document}
254326$if(title)$
327+$if(beamer)$
328+\frame{\titlepage}
329+$else$
255330\maketitle
256331$endif$
257332$if(abstract)$
@@ -259,12 +334,18 @@ $if(abstract)$
259334$abstract$
260335\end{abstract}
261336$endif$
337+$endif$
262338
263339$for(include-before)$
264340$include-before$
265341
266342$endfor$
267343$if(toc)$
344+$if(beamer)$
345+\begin{frame}
346+\tableofcontents[hideallsubsections]
347+\end{frame}
348+$else$
268349{
269350$if(colorlinks)$
270351\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
@@ -273,6 +354,7 @@ $endif$
273354\tableofcontents
274355}
275356$endif$
357+$endif$
276358$if(lot)$
277359\listoftables
278360$endif$
@@ -290,12 +372,26 @@ $else$
290372\renewcommand\refname{$biblio-title$}
291373$endif$
292374$endif$
375+$if(beamer)$
376+\begin{frame}[allowframebreaks]{$biblio-title$}
377+\bibliographytrue
378+$endif$
293379\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
380+$if(beamer)$
381+\end{frame}
382+$endif$
294383
295384$endif$
296385$endif$
297386$if(biblatex)$
387+$if(beamer)$
388+\begin{frame}[allowframebreaks]{$biblio-title$}
389+\bibliographytrue
390+\printbibliography[heading=none]
391+\end{frame}
392+$else$
298393\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
394+$endif$
299395
300396$endif$
301397$for(include-after)$