git.iko.soy/typeable/pandoc
on master help sign in
Realign LaTeX and beamer templates.

Adds new language and bidi variables; removes duplicated `\VerbatimFootnotes`. The standard `fontspec` variables, previously omitted, are now included. Beamer defaults to the font set as `sansfont`. If `mainfont` is set, the `serif` font theme will also be used, which uses this for the slide text (does not have to be a serif font per se). The paragraph indentation and use of the `url` package seem to have had no visible effect, and have been removed.

commit92e66456ec773382b644c1eda72bef8c25474860 authorAndrew Dunning <andunning@gmail.com> dateSun 11 Oct 2015, 01:39 (11 years ago) parentff0db28
2 files changed+78−40
default.beamer+77−36 default.latex+1−4
default.beamer+77−36
@@ -1,4 +1,4 @@
1−\documentclass[$if(fontsize)$$fontsize$,$endif$$if(handout)$handout,$endif$$if(beamer)$ignorenonframetext,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
1+\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(handout)$handout,$endif$$if(beamer)$ignorenonframetext,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
22$if(theme)$
33\usetheme{$theme$}
44$endif$
@@ -8,6 +8,9 @@ $endif$
88$if(fonttheme)$
99\usefonttheme{$fonttheme$}
1010$endif$
11+$if(mainfont)$
12+\usefonttheme{serif} % use mainfont rather than sansfont for slide text
13+$endif$
1114$if(innertheme)$
1215\useinnertheme{$innertheme$}
1316$endif$
@@ -17,34 +20,66 @@ $endif$
1720\setbeamertemplate{caption}[numbered]
1821\setbeamertemplate{caption label separator}{: }
1922\setbeamercolor{caption name}{fg=normal text.fg}
23+$if(fontfamily)$
24+\usepackage[$fontfamilyoptions$]{$fontfamily$}
25+$else$
26+\usepackage{lmodern}
27+$endif$
2028\usepackage{amssymb,amsmath}
2129\usepackage{ifxetex,ifluatex}
2230\usepackage{fixltx2e} % provides \textsubscript
23−\usepackage{lmodern}
24−\ifxetex
25− \usepackage{fontspec,xltxtra,xunicode}
26− \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
27− \newcommand{\euro}{€}
28−\else
29− \ifluatex
30− \usepackage{fontspec}
31− \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
32− \newcommand{\euro}{€}
31+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
32+ \usepackage[T1]{fontenc}
33+ \usepackage[utf8]{inputenc}
34+$if(euro)$
35+ \usepackage{eurosym}
36+$endif$
37+\else % if luatex or xelatex
38+ \ifxetex
39+ \usepackage{mathspec}
3340 \else
34− \usepackage[T1]{fontenc}
35− \usepackage[utf8]{inputenc}
36− $if(euro)$
37− \usepackage{eurosym}
38− $endif$
41+ \usepackage{fontspec}
3942 \fi
43+ \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
44+ \newcommand{\euro}{€}
45+$if(mainfont)$
46+ \setmainfont[$mainfontoptions$]{$mainfont$}
47+$endif$
48+$if(sansfont)$
49+ \setsansfont[$sansfontoptions$]{$sansfont$}
50+$endif$
51+$if(monofont)$
52+ \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$monofontoptions$$endif$]{$monofont$}
53+$endif$
54+$if(mathfont)$
55+ \setmathfont(Digits,Latin,Greek)[$mathfontoptions$]{$mathfont$}
56+$endif$
57+$if(CJKmainfont)$
58+ \usepackage{xeCJK}
59+ \setCJKmainfont[$CJKoptions$]{$CJKmainfont$}
60+$endif$
4061\fi
4162% use upquote if available, for straight quotes in verbatim environments
4263\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
4364% use microtype if available
44−\IfFileExists{microtype.sty}{\usepackage{microtype}}{}
65+\IfFileExists{microtype.sty}{%
66+\usepackage{microtype}
67+\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
68+}{}
69+$if(lang)$
70+\ifxetex
71+ \usepackage{polyglossia}
72+ \setmainlanguage[$polyglossia-lang.options$]{$polyglossia-lang.name$}
73+$for(polyglossia-otherlangs)$
74+ \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$}
75+$endfor$
76+\else
77+ \usepackage[shorthands=off,$babel-lang$]{babel}
78+\fi
79+$endif$
4580$if(natbib)$
4681\usepackage{natbib}
47−\bibliographystyle{plainnat}
82+\bibliographystyle{$if(biblio-style)$$biblio-style$$else$plainnat$endif$}
4883$endif$
4984$if(biblatex)$
5085\usepackage{biblatex}
@@ -63,6 +98,7 @@ $highlighting-macros$
6398$endif$
6499$if(verbatim-in-note)$
65100\usepackage{fancyvrb}
101+\VerbatimFootnotes % allows verbatim text in footnotes
66102$endif$
67103$if(tables)$
68104\usepackage{longtable,booktabs}
@@ -72,11 +108,8 @@ $if(tables)$
72108\def\fnum@table{\tablename~\thetable}
73109\makeatother
74110$endif$
75−$if(url)$
76−\usepackage{url}
77−$endif$
78111$if(graphics)$
79−\usepackage{graphicx}
112+\usepackage{graphicx,grffile}
80113\makeatletter
81114\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
82115\def\maxheight{\ifdim\Gin@nat@height>\textheight0.8\textheight\else\Gin@nat@height\fi}
@@ -105,35 +138,40 @@ $endif$
105138 \frame{\subsectionpage}
106139}
107140
141+$if(links-as-notes)$
142+% Make links footnotes instead of hotlinks:
143+\renewcommand{\href}[2]{#2\footnote{\url{#1}}}
144+$endif$
108145$if(strikeout)$
109146\usepackage[normalem]{ulem}
110147% avoid problems with \sout in headers with hyperref:
111148\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
112149$endif$
113−\setlength{\parindent}{0pt}
114−\setlength{\parskip}{6pt plus 2pt minus 1pt}
115150\setlength{\emergencystretch}{3em} % prevent overfull lines
116151\providecommand{\tightlist}{%
117152 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
118153$if(numbersections)$
154+\setcounter{secnumdepth}{5}
119155$else$
120156\setcounter{secnumdepth}{0}
121157$endif$
122−$if(verbatim-in-note)$
123−\VerbatimFootnotes % allows verbatim text in footnotes
124−$endif$
125−$if(lang)$
158+$if(dir)$
126159\ifxetex
127− \usepackage{polyglossia}
128− \setmainlanguage{$mainlang$}
129− \setotherlanguages{$for(otherlang)$$otherlang$$sep$,$endfor$}
130−\else
131− \usepackage[shorthands=off,$lang$]{babel}
160+ % load bidi as late as possible as it modifies e.g. graphicx
161+ $if(latex-dir-rtl)$
162+ \usepackage[RTLdocument]{bidi}
163+ $else$
164+ \usepackage{bidi}
165+ $endif$
166+\fi
167+\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
168+ \TeXXeTstate=1
169+ \newcommand{\RL}[1]{\beginR #1\endR}
170+ \newcommand{\LR}[1]{\beginL #1\endL}
171+ \newenvironment{RTL}{\beginR}{\endR}
172+ \newenvironment{LTR}{\beginL}{\endL}
132173\fi
133174$endif$
134−$for(header-includes)$
135−$header-includes$
136−$endfor$
137175
138176$if(title)$
139177\title{$title$}
@@ -145,6 +183,9 @@ $if(author)$
145183\author{$for(author)$$author$$sep$ \and $endfor$}
146184$endif$
147185\date{$date$}
186+$for(header-includes)$
187+$header-includes$
188+$endfor$
148189
149190\begin{document}
150191$if(title)$
default.latex+1−4
@@ -110,7 +110,7 @@ $highlighting-macros$
110110$endif$
111111$if(verbatim-in-note)$
112112\usepackage{fancyvrb}
113−\VerbatimFootnotes
113+\VerbatimFootnotes % allows verbatim text in footnotes
114114$endif$
115115$if(tables)$
116116\usepackage{longtable,booktabs}
@@ -145,9 +145,6 @@ $if(numbersections)$
145145$else$
146146\setcounter{secnumdepth}{0}
147147$endif$
148−$if(verbatim-in-note)$
149−\VerbatimFootnotes % allows verbatim text in footnotes
150−$endif$
151148$if(dir)$
152149\ifxetex
153150 % load bidi as late as possible as it modifies e.g. graphicx