Merge pull request #3879 from adunning/patch-1

Combine LaTeX/Beamer templates
This commit is contained in:
John MacFarlane 2017-09-08 10:43:35 -07:00 committed by GitHub
commit 91240d08b7
2 changed files with 106 additions and 15 deletions

View file

@ -196,7 +196,7 @@ are available: [`amsfonts`], [`amsmath`], [`lm`], [`unicode-math`],
[`ifxetex`], [`ifluatex`], [`eurosym`], [`listings`] (if the
`--listings` option is used), [`fancyvrb`], [`longtable`],
[`booktabs`], [`graphicx`] and [`grffile`] (if the document
contains images), [`hyperref`], [`ulem`], [`geometry`] (with the
contains images), [`hyperref`], [`xcolor`] (with `colorlinks`), [`ulem`], [`geometry`] (with the
`geometry` variable set), [`setspace`] (with `linestretch`), and
[`babel`] (with `lang`). The use of `xelatex` or `lualatex` as
the LaTeX engine requires [`fontspec`]. `xelatex` uses
@ -1350,14 +1350,6 @@ including all [reveal.js configuration options].
: when true, the `beamerarticle` package is loaded (for
producing an article from beamer slides).
`colorlinks`
: add color to link text; automatically enabled if any of `linkcolor`, `citecolor`,
`urlcolor`, or `toccolor` are set (for beamer only).
`linkcolor`, `citecolor`, `urlcolor`, `toccolor`
: color for internal links, citation links, external links, and links in table
of contents: uses any of the [predefined LaTeX colors] (for beamer only).
`aspectratio`
: aspect ratio of slides (for beamer only, `1610` for 16:10, `169` for 16:9,
`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].
`linkcolor`, `citecolor`, `urlcolor`, `toccolor`
: color for internal links, citation links, external links, and links in table of contents:
uses any of the [predefined LaTeX colors]
uses options allowed by [`xcolor`], including the `dvipsnames`, `svgnames`, and `x11names` lists
`links-as-notes`
: causes links to be printed as footnotes
@ -1478,7 +1470,7 @@ LaTeX variables are used when [creating a PDF].
[`book`]: https://ctan.org/pkg/book
[KOMA-Script]: https://ctan.org/pkg/koma-script
[`memoir`]: https://ctan.org/pkg/memoir
[predefined LaTeX colors]: https://en.wikibooks.org/wiki/LaTeX/Colors#Predefined_colors
[`xcolor`]: https://ctan.org/pkg/xcolor
[LaTeX Font Catalogue]: http://www.tug.dk/FontCatalogue/
[`mathpazo`]: https://ctan.org/pkg/mathpazo
[LaTeX font encodings]: https://ctan.org/pkg/encguide
@ -4326,7 +4318,7 @@ Hubert Plociniczak,
Ilya V. Portnov,
Ivo Clarysse,
J. Lewis Muir,
Jaime Marquínez Ferrándiz,
Jaime Marquínez Ferrándiz,
Jakob Voß,
James Aspnes,
Jamie F. Olson,

View file

@ -1,10 +1,16 @@
\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
\PassOptionsToPackage{hyphens}{url}
$if(colorlinks)$
\PassOptionsToPackage{usenames,dvipsnames}{color}
\PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor}
$endif$
%
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
\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$}
$if(beamer)$
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{caption label separator}{: }
\setbeamercolor{caption name}{fg=normal text.fg}
\beamertemplatenavigationsymbols$if(navigation)$$navigation$$else$empty$endif$
$endif$
$if(beamerarticle)$
\usepackage{beamerarticle} % needs to be loaded first
$endif$
@ -81,6 +87,26 @@ $if(CJKmainfont)$
\fi
$endif$
\fi
$if(beamer)$
$if(theme)$
\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
$endif$
$if(colortheme)$
\usecolortheme{$colortheme$}
$endif$
$if(fonttheme)$
\usefonttheme{$fonttheme$}
$endif$
$if(mainfont)$
\usefonttheme{serif} % use mainfont rather than sansfont for slide text
$endif$
$if(innertheme)$
\useinnertheme{$innertheme$}
$endif$
$if(outertheme)$
\useoutertheme{$outertheme$}
$endif$
$endif$
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
@ -100,6 +126,9 @@ $endif$
$if(verbatim-in-note)$
\usepackage{fancyvrb}
$endif$
$if(colorlinks)$
\usepackage{xcolor}
$endif$
\usepackage{hyperref}
\hypersetup{
$if(title-meta)$
@ -127,6 +156,9 @@ $endif$
$if(geometry)$
\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
$endif$
$if(beamer)$
\newif\ifbibliography
$endif$
$if(natbib)$
\usepackage[$natbiboptions$]{natbib}
\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
@ -151,6 +183,13 @@ $if(tables)$
\usepackage{longtable,booktabs}
% Fix footnotes in tables (requires footnote package)
\IfFileExists{footnote.sty}{\usepackage{footnote}\makesavenoteenv{longtable}}{}
$if(beamer)$
\usepackage{caption}
% These lines are needed to make table captions work with longtable:
\makeatletter
\def\fnum@table{\tablename~\thetable}
\makeatother
$endif$
$endif$
$if(graphics)$
\usepackage{graphicx,grffile}
@ -163,6 +202,31 @@ $if(graphics)$
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
$endif$
$if(beamer)$
% Prevent slide breaks in the middle of a paragraph:
\widowpenalties 1 10000
\raggedbottom
$if(section-titles)$
\AtBeginPart{
\let\insertpartnumber\relax
\let\partname\relax
\frame{\partpage}
}
\AtBeginSection{
\ifbibliography
\else
\let\insertsectionnumber\relax
\let\sectionname\relax
\frame{\sectionpage}
\fi
}
\AtBeginSubsection{
\let\insertsubsectionnumber\relax
\let\subsectionname\relax
\frame{\subsectionpage}
}
$endif$
$endif$
$if(links-as-notes)$
% Make links footnotes instead of hotlinks:
\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}}
@ -180,6 +244,8 @@ $if(numbersections)$
$else$
\setcounter{secnumdepth}{0}
$endif$
$if(beamer)$
$else$
$if(subparagraph)$
$else$
% Redefines (sub)paragraphs to behave more like sections
@ -192,6 +258,7 @@ $else$
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
$endif$
$endif$
% set default figure placement to htbp
\makeatletter
@ -249,9 +316,20 @@ $if(institute)$
\institute{$for(institute)$$institute$$sep$ \and $endfor$}
$endif$
\date{$date$}
$if(beamer)$
$if(titlegraphic)$
\titlegraphic{\includegraphics{$titlegraphic$}}
$endif$
$if(logo)$
\logo{\includegraphics{$logo$}}
$endif$
$endif$
\begin{document}
$if(title)$
$if(beamer)$
\frame{\titlepage}
$else$
\maketitle
$endif$
$if(abstract)$
@ -259,20 +337,27 @@ $if(abstract)$
$abstract$
\end{abstract}
$endif$
$endif$
$for(include-before)$
$include-before$
$endfor$
$if(toc)$
$if(beamer)$
\begin{frame}
\tableofcontents[hideallsubsections]
\end{frame}
$else$
{
$if(colorlinks)$
\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$black$endif$}
\hypersetup{linkcolor=$if(toccolor)$$toccolor$$else$$endif$}
$endif$
\setcounter{tocdepth}{$toc-depth$}
\tableofcontents
}
$endif$
$endif$
$if(lot)$
\listoftables
$endif$
@ -290,12 +375,26 @@ $else$
\renewcommand\refname{$biblio-title$}
$endif$
$endif$
$if(beamer)$
\begin{frame}[allowframebreaks]{$biblio-title$}
\bibliographytrue
$endif$
\bibliography{$for(bibliography)$$bibliography$$sep$,$endfor$}
$if(beamer)$
\end{frame}
$endif$
$endif$
$endif$
$if(biblatex)$
$if(beamer)$
\begin{frame}[allowframebreaks]{$biblio-title$}
\bibliographytrue
\printbibliography[heading=none]
\end{frame}
$else$
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
$endif$
$endif$
$for(include-after)$