├── .gitignore
├── Makefile
├── NEWS
├── README.md
├── demo
├── demo.bib
├── demo.tex
├── logo.eps
├── logo.pdf
└── logo.svg
├── doc
└── metropolistheme.dtx
├── docker
├── Dockerfile
└── getFiraFont.sh
└── source
├── beamercolorthememetropolis-highcontrast.dtx
├── beamercolorthememetropolis.dtx
├── beamerfontthememetropolis.dtx
├── beamerinnerthememetropolis.dtx
├── beamerouterthememetropolis.dtx
├── beamerthememetropolis.dtx
├── beamerthememetropolis.ins
└── pgfplotsthemetol.dtx
/.gitignore:
--------------------------------------------------------------------------------
1 | # Temporary files
2 |
3 | .latex-cache
4 | *.acn
5 | *.acr
6 | *.alg
7 | *.aux
8 | *.bbl
9 | *.blg
10 | *.dvi
11 | *.fdb_latexmk
12 | *.fls
13 | *.glg
14 | *.glo
15 | *.gls
16 | *.idx
17 | *.ilg
18 | *.ind
19 | *.ist
20 | *.lof
21 | *.log
22 | *.lot
23 | *.maf
24 | *.mtc
25 | *.mtc0
26 | *.nav
27 | *.nlo
28 | *.out
29 | *.pdfsync
30 | *.ps
31 | *.snm
32 | *.synctex.gz
33 | *.toc
34 | *.vrb
35 | *.xdy
36 | *.tdo
37 |
38 |
39 | # Output
40 |
41 | *.sty
42 | doc/metropolistheme.pdf
43 | demo/demo.pdf
44 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | MAKEFLAGS := -j 1
2 | INS = source/beamerthememetropolis.ins
3 | PACKAGE_SRC = $(wildcard source/*.dtx)
4 | PACKAGE_STY = $(notdir $(PACKAGE_SRC:%.dtx=%.sty))
5 | DEMO_SRC = demo/demo.tex demo/demo.bib
6 | DEMO_PDF = demo/demo.pdf
7 | DOC_SRC = doc/metropolistheme.dtx
8 | DOC_PDF = doc/metropolistheme.pdf
9 |
10 | CTAN_CONTENT = README.md $(INS) $(PACKAGE_SRC) $(DOC_SRC) $(DOC_PDF) $(DEMO_SRC) $(DEMO_PDF)
11 |
12 | DESTDIR ?= $(shell kpsewhich -var-value=TEXMFHOME)
13 | INSTALL_DIR = $(DESTDIR)/tex/latex/metropolis
14 | DOC_DIR = $(DESTDIR)/doc/latex/metropolis
15 | CACHE_DIR := $(shell pwd)/.latex-cache
16 |
17 | COMPILE_TEX := latexmk -xelatex -output-directory=$(CACHE_DIR)
18 | export TEXINPUTS:=$(shell pwd):$(shell pwd)/source:${TEXINPUTS}
19 |
20 | DOCKER_IMAGE = latex-image
21 | DOCKER_CONTAINER = latex-container
22 |
23 | .PHONY: all sty doc demo clean install uninstall ctan clean-cache clean-sty ctan-version docker-run docker-build docker-rm
24 |
25 | all: sty doc
26 |
27 | sty: $(PACKAGE_STY)
28 |
29 | doc: $(DOC_PDF)
30 |
31 | demo: $(DEMO_PDF)
32 |
33 | clean: clean-cache clean-sty
34 |
35 | install: $(PACKAGE_STY) $(DOC_PDF)
36 | @mkdir -p $(INSTALL_DIR)
37 | @cp $(PACKAGE_STY) $(INSTALL_DIR)
38 | @mkdir -p $(DOC_DIR)
39 | @cp $(DOC_PDF) $(DOC_DIR)
40 |
41 | uninstall:
42 | @rm -f "$(addprefix $(INSTALL_DIR)/, $(PACKAGE_STY))"
43 | @rmdir "$(INSTALL_DIR)"
44 | @rm -f "$(DOC_DIR)/$(notdir $(DOC_PDF))"
45 | @rmdir "$(DOC_DIR)"
46 |
47 | clean-cache:
48 | @rm -rf "$(CACHE_DIR)"
49 |
50 | clean-sty:
51 | @rm -f $(PACKAGE_STY)
52 |
53 | ctan: $(CTAN_CONTENT) ctan-version
54 | @tar --transform "s@\(.*\)@metropolis/\1@" -cf metropolis-$(shell date "+%Y-%m-%d").tar.gz $(CTAN_CONTENT)
55 |
56 | ctan-version:
57 | @sed -i 's@20[0-9][0-9]/[0-9]*/[0-9]*@$(shell date "+%Y/%m/%d")@' $(PACKAGE_SRC)
58 |
59 | $(CACHE_DIR):
60 | @mkdir -p $(CACHE_DIR)
61 |
62 | $(PACKAGE_STY): $(PACKAGE_SRC) $(INS) | clean-cache $(CACHE_DIR)
63 | @cd $(dir $(INS)) && latex -output-directory=$(CACHE_DIR) $(notdir $(INS))
64 | @cp $(addprefix $(CACHE_DIR)/,$(PACKAGE_STY)) .
65 |
66 | $(DOC_PDF): $(DOC_SRC) $(PACKAGE_STY) | clean-cache $(CACHE_DIR)
67 | @cd $(dir $(DOC_SRC)) && $(COMPILE_TEX) $(notdir $(DOC_SRC))
68 | @cp $(CACHE_DIR)/$(notdir $(DOC_PDF)) $(DOC_PDF)
69 |
70 | $(DEMO_PDF): $(DEMO_SRC) $(PACKAGE_STY) | clean-cache $(CACHE_DIR)
71 | @cd $(dir $(DEMO_SRC)) && $(COMPILE_TEX) $(notdir $(DEMO_SRC))
72 | @cp $(CACHE_DIR)/$(notdir $(DEMO_PDF)) $(DEMO_PDF)
73 |
74 | docker-run: docker-build
75 | docker run --rm=true --name $(DOCKER_CONTAINER) -i -t -v `pwd`:/data $(DOCKER_IMAGE) make
76 |
77 | docker-build:
78 | docker build -t $(DOCKER_IMAGE) docker
79 |
80 | docker-rm:
81 | docker rm $(DOCKER_CONTAINER)
82 |
--------------------------------------------------------------------------------
/NEWS:
--------------------------------------------------------------------------------
1 | Overview of changes in Metropolis 1.2
2 | =====================================
3 |
4 | * New features:
5 |
6 | - Added a highcontrast color theme
7 |
8 | * Bugs fixed:
9 |
10 | - Fixed issues with Beamer 3.37+
11 | - Fix the "Overfull \hbox (0.4pt too wide)" bug when using progress bar.
12 | - Only load fontspec if it’s not loaded
13 | - Fix problem w/ inverting colours mid-presentation
14 | - Use sectiontitleformat for subsection title
15 | - Fix empty second line in certain frametitles
16 | - Fixed #206, #214, #216
17 |
18 |
19 | Overview of changes in Metropolis 1.1
20 | =====================================
21 |
22 | * New features:
23 |
24 | - Support backup slides
25 | - Support for subsections
26 | - Add standout frame key for standout slides
27 |
28 | * Bugs fixed:
29 |
30 | - Avoid justification of title in section pages.
31 | - Improve frame title with new struts
32 | - Fix multi-line block titles
33 | - Ensure consistent line height
34 | - Known issue with beamercolortheme fly
35 | - Do not increase frame number for section and titlepage
36 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Metropolis
2 |
3 |
4 | **IMPORTANT NOTICES FOR VERSION 1.0**
5 |
6 | * The package and theme name changed from *m* to *metropolis*!
7 | * The `title format` values have been restructured. Please refer to the
8 | [manual][].
9 |
10 | ---
11 |
12 | Metropolis is a simple, modern Beamer theme suitable for anyone to use. It tries
13 | to minimize noise and maximize space for content; the only visual flourish it
14 | offers is an (optional) progress bar added to each slide. The core design
15 | principles of the theme were described in a blog post
16 | [here](http://bloerg.net/2014/09/20/a-modern-beamer-theme.html).
17 |
18 | Not convinced? Have a look at the [demo slides][].
19 |
20 | 
21 |
22 |
23 | ## Installation
24 |
25 | To install a stable version of this theme, please refer to update instructions
26 | of your TeX distribution. Metropolis is on [CTAN][] since December
27 | 2014 thus it is part of MikTeX and will be part of TeX Live 2016.
28 |
29 | Installing Metropolis from source, like any Beamer theme, involves four easy
30 | steps:
31 |
32 | 1. **Download the source** with a `git clone` of the [Metropolis repository](https://github.com/matze/mtheme)
33 | or as a [zip archive](https://github.com/matze/mtheme/archive/master.zip) of
34 | the latest development version.
35 | 2. **Compile the style files** by running `make sty` inside the downloaded
36 | directory. (Or run LaTeX directly on `source/metropolistheme.ins`.)
37 | 3. **Move the resulting `*.sty` files** to the folder containing your
38 | presentation. To use Metropolis with many presentations, run `make install`
39 | or move the `*.sty` files to a folder in your TeX path instead (might require
40 | `sudo` rights).
41 | 4. **Use the theme for your presentation** by declaring `\usetheme{metropolis}` in
42 | the preamble of your Beamer document.
43 | 5. **For best results** install Mozilla's [Fira Sans](https://github.com/bBoxType/FiraSans).
44 |
45 |
46 | ## Usage
47 |
48 | The following code shows a minimal example of a Beamer presentation using
49 | Metropolis.
50 |
51 | ```latex
52 | \documentclass{beamer}
53 | \usetheme{metropolis} % Use metropolis theme
54 | \title{A minimal example}
55 | \date{\today}
56 | \author{Matthias Vogelgesang}
57 | \institute{Centre for Modern Beamer Themes}
58 | \begin{document}
59 | \maketitle
60 | \section{First Section}
61 | \begin{frame}{First Frame}
62 | Hello, world!
63 | \end{frame}
64 | \end{document}
65 | ```
66 |
67 | Detailed information on using Metropolis can be found in the [manual][].
68 |
69 | For an alternative dark color theme, please have a look at Ross Churchley's
70 | excellent [owl](https://github.com/rchurchley/beamercolortheme-owl) theme.
71 |
72 |
73 | ## License
74 |
75 | The theme itself is licensed under a [Creative Commons Attribution-ShareAlike
76 | 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/). This
77 | means that if you change the theme and re-distribute it, you *must* retain the
78 | copyright notice header and license it under the same CC-BY-SA license. This
79 | does not affect the presentation that you create with the theme.
80 |
81 |
82 | [demo slides]: http://mirrors.ctan.org/macros/latex/contrib/beamer-contrib/themes/metropolis/demo/demo.pdf
83 | [manual]: http://mirrors.ctan.org/macros/latex/contrib/beamer-contrib/themes/metropolis/doc/metropolistheme.pdf
84 | [CTAN]: http://ctan.org/pkg/beamertheme-metropolis
85 |
--------------------------------------------------------------------------------
/demo/demo.bib:
--------------------------------------------------------------------------------
1 | @article{Knuth92,
2 | author = "D.E. Knuth",
3 | title = "Two notes on notation",
4 | journal = "Amer. Math. Monthly",
5 | volume = "99",
6 | year = "1992",
7 | pages = "403--422",
8 | }
9 |
10 | @book{ConcreteMath,
11 | author = "R.L. Graham and D.E. Knuth and O. Patashnik",
12 | title = "Concrete mathematics",
13 | publisher = "Addison-Wesley",
14 | address = "Reading, MA",
15 | year = "1989"
16 | }
17 |
18 | @unpublished{Simpson,
19 | author = "H. Simpson",
20 | title = "Proof of the {R}iemann {H}ypothesis",
21 | note = "preprint (2003), available at
22 | \texttt{http://www.math.drofnats.edu/riemann.ps}",
23 | year = "2003"
24 | }
25 |
26 | @incollection{Er01,
27 | author = "P. Erd{\H o}s",
28 | title = "A selection of problems and results in combinatorics",
29 | booktitle = "Recent trends in combinatorics (Matrahaza, 1995)",
30 | publisher = "Cambridge Univ. Press",
31 | address = "Cambridge",
32 | pages = "1--6",
33 | year = "1995"
34 | }
35 | @article{greenwade93,
36 | author = "George D. Greenwade",
37 | title = "The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})",
38 | year = "1993",
39 | journal = "TUGBoat",
40 | volume = "14",
41 | number = "3",
42 | pages = "342--351"
43 | }
44 |
--------------------------------------------------------------------------------
/demo/demo.tex:
--------------------------------------------------------------------------------
1 | \documentclass[10pt]{beamer}
2 |
3 | \usetheme{metropolis}
4 | \usepackage{appendixnumberbeamer}
5 |
6 | \usepackage{booktabs}
7 | \usepackage[scale=2]{ccicons}
8 |
9 | \usepackage{pgfplots}
10 | \usepgfplotslibrary{dateplot}
11 |
12 | \usepackage{xspace}
13 | \newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}
14 |
15 | \title{Metropolis}
16 | \subtitle{A modern beamer theme}
17 | \date{\today}
18 | \author{Matthias Vogelgesang}
19 | \institute{Center for modern beamer themes}
20 | % \titlegraphic{\hfill\includegraphics[height=1.5cm]{logo.pdf}}
21 |
22 | \begin{document}
23 |
24 | \maketitle
25 |
26 | \begin{frame}{Table of contents}
27 | \setbeamertemplate{section in toc}[sections numbered]
28 | \tableofcontents[hideallsubsections]
29 | \end{frame}
30 |
31 | \section{Introduction}
32 |
33 | \begin{frame}[fragile]{Metropolis}
34 |
35 | The \themename theme is a Beamer theme with minimal visual noise
36 | inspired by the \href{https://github.com/hsrmbeamertheme/hsrmbeamertheme}{\textsc{hsrm} Beamer
37 | Theme} by Benjamin Weiss.
38 |
39 | Enable the theme by loading
40 |
41 | \begin{verbatim} \documentclass{beamer}
42 | \usetheme{metropolis}\end{verbatim}
43 |
44 | Note, that you have to have Mozilla's \emph{Fira Sans} font and XeTeX
45 | installed to enjoy this wonderful typography.
46 | \end{frame}
47 | \begin{frame}[fragile]{Sections}
48 | Sections group slides of the same topic
49 |
50 | \begin{verbatim} \section{Elements}\end{verbatim}
51 |
52 | for which \themename provides a nice progress indicator \ldots
53 | \end{frame}
54 |
55 | \section{Title formats}
56 |
57 | \begin{frame}{Metropolis title formats}
58 | \themename supports 4 different title formats:
59 | \begin{itemize}
60 | \item Regular
61 | \item \textsc{Small caps}
62 | \item \textsc{all small caps}
63 | \item ALL CAPS
64 | \end{itemize}
65 | They can either be set at once for every title type or individually.
66 | \end{frame}
67 |
68 | {
69 | \metroset{titleformat frame=smallcaps}
70 | \begin{frame}{Small caps}
71 | This frame uses the \texttt{smallcaps} title format.
72 |
73 | \begin{alertblock}{Potential Problems}
74 | Be aware that not every font supports small caps. If for example you typeset your presentation with pdfTeX and the Computer Modern Sans Serif font, every text in small caps will be typeset with the Computer Modern Serif font instead.
75 | \end{alertblock}
76 | \end{frame}
77 | }
78 |
79 | {
80 | \metroset{titleformat frame=allsmallcaps}
81 | \begin{frame}{All small caps}
82 | This frame uses the \texttt{allsmallcaps} title format.
83 |
84 | \begin{alertblock}{Potential problems}
85 | As this title format also uses small caps you face the same problems as with the \texttt{smallcaps} title format. Additionally this format can cause some other problems. Please refer to the documentation if you consider using it.
86 |
87 | As a rule of thumb: just use it for plaintext-only titles.
88 | \end{alertblock}
89 | \end{frame}
90 | }
91 |
92 | {
93 | \metroset{titleformat frame=allcaps}
94 | \begin{frame}{All caps}
95 | This frame uses the \texttt{allcaps} title format.
96 |
97 | \begin{alertblock}{Potential Problems}
98 | This title format is not as problematic as the \texttt{allsmallcaps} format, but basically suffers from the same deficiencies. So please have a look at the documentation if you want to use it.
99 | \end{alertblock}
100 | \end{frame}
101 | }
102 |
103 | \section{Elements}
104 |
105 | \begin{frame}[fragile]{Typography}
106 | \begin{verbatim}The theme provides sensible defaults to
107 | \emph{emphasize} text, \alert{accent} parts
108 | or show \textbf{bold} results.\end{verbatim}
109 |
110 | \begin{center}becomes\end{center}
111 |
112 | The theme provides sensible defaults to \emph{emphasize} text,
113 | \alert{accent} parts or show \textbf{bold} results.
114 | \end{frame}
115 |
116 | \begin{frame}{Font feature test}
117 | \begin{itemize}
118 | \item Regular
119 | \item \textit{Italic}
120 | \item \textsc{Small Caps}
121 | \item \textbf{Bold}
122 | \item \textbf{\textit{Bold Italic}}
123 | \item \textbf{\textsc{Bold Small Caps}}
124 | \item \texttt{Monospace}
125 | \item \texttt{\textit{Monospace Italic}}
126 | \item \texttt{\textbf{Monospace Bold}}
127 | \item \texttt{\textbf{\textit{Monospace Bold Italic}}}
128 | \end{itemize}
129 | \end{frame}
130 |
131 | \begin{frame}{Lists}
132 | \begin{columns}[T,onlytextwidth]
133 | \column{0.33\textwidth}
134 | Items
135 | \begin{itemize}
136 | \item Milk \item Eggs \item Potatoes
137 | \end{itemize}
138 |
139 | \column{0.33\textwidth}
140 | Enumerations
141 | \begin{enumerate}
142 | \item First, \item Second and \item Last.
143 | \end{enumerate}
144 |
145 | \column{0.33\textwidth}
146 | Descriptions
147 | \begin{description}
148 | \item[PowerPoint] Meeh. \item[Beamer] Yeeeha.
149 | \end{description}
150 | \end{columns}
151 | \end{frame}
152 | \begin{frame}{Animation}
153 | \begin{itemize}[<+- | alert@+>]
154 | \item \alert<4>{This is\only<4>{ really} important}
155 | \item Now this
156 | \item And now this
157 | \end{itemize}
158 | \end{frame}
159 | \begin{frame}{Figures}
160 | \begin{figure}
161 | \newcounter{density}
162 | \setcounter{density}{20}
163 | \begin{tikzpicture}
164 | \def\couleur{alerted text.fg}
165 | \path[coordinate] (0,0) coordinate(A)
166 | ++( 90:5cm) coordinate(B)
167 | ++(0:5cm) coordinate(C)
168 | ++(-90:5cm) coordinate(D);
169 | \draw[fill=\couleur!\thedensity] (A) -- (B) -- (C) --(D) -- cycle;
170 | \foreach \x in {1,...,40}{%
171 | \pgfmathsetcounter{density}{\thedensity+20}
172 | \setcounter{density}{\thedensity}
173 | \path[coordinate] coordinate(X) at (A){};
174 | \path[coordinate] (A) -- (B) coordinate[pos=.10](A)
175 | -- (C) coordinate[pos=.10](B)
176 | -- (D) coordinate[pos=.10](C)
177 | -- (X) coordinate[pos=.10](D);
178 | \draw[fill=\couleur!\thedensity] (A)--(B)--(C)-- (D) -- cycle;
179 | }
180 | \end{tikzpicture}
181 | \caption{Rotated square from
182 | \href{http://www.texample.net/tikz/examples/rotated-polygons/}{texample.net}.}
183 | \end{figure}
184 | \end{frame}
185 | \begin{frame}{Tables}
186 | \begin{table}
187 | \caption{Largest cities in the world (source: Wikipedia)}
188 | \begin{tabular}{@{} lr @{}}
189 | \toprule
190 | City & Population\\
191 | \midrule
192 | Mexico City & 20,116,842\\
193 | Shanghai & 19,210,000\\
194 | Peking & 15,796,450\\
195 | Istanbul & 14,160,467\\
196 | \bottomrule
197 | \end{tabular}
198 | \end{table}
199 | \end{frame}
200 | \begin{frame}{Blocks}
201 | Three different block environments are pre-defined and may be styled with an
202 | optional background color.
203 |
204 | \begin{columns}[T,onlytextwidth]
205 | \column{0.5\textwidth}
206 | \begin{block}{Default}
207 | Block content.
208 | \end{block}
209 |
210 | \begin{alertblock}{Alert}
211 | Block content.
212 | \end{alertblock}
213 |
214 | \begin{exampleblock}{Example}
215 | Block content.
216 | \end{exampleblock}
217 |
218 | \column{0.5\textwidth}
219 |
220 | \metroset{block=fill}
221 |
222 | \begin{block}{Default}
223 | Block content.
224 | \end{block}
225 |
226 | \begin{alertblock}{Alert}
227 | Block content.
228 | \end{alertblock}
229 |
230 | \begin{exampleblock}{Example}
231 | Block content.
232 | \end{exampleblock}
233 |
234 | \end{columns}
235 | \end{frame}
236 | \begin{frame}{Math}
237 | \begin{equation*}
238 | e = \lim_{n\to \infty} \left(1 + \frac{1}{n}\right)^n
239 | \end{equation*}
240 | \end{frame}
241 | \begin{frame}{Line plots}
242 | \begin{figure}
243 | \begin{tikzpicture}
244 | \begin{axis}[
245 | mlineplot,
246 | width=0.9\textwidth,
247 | height=6cm,
248 | ]
249 |
250 | \addplot {sin(deg(x))};
251 | \addplot+[samples=100] {sin(deg(2*x))};
252 |
253 | \end{axis}
254 | \end{tikzpicture}
255 | \end{figure}
256 | \end{frame}
257 | \begin{frame}{Bar charts}
258 | \begin{figure}
259 | \begin{tikzpicture}
260 | \begin{axis}[
261 | mbarplot,
262 | xlabel={Foo},
263 | ylabel={Bar},
264 | width=0.9\textwidth,
265 | height=6cm,
266 | ]
267 |
268 | \addplot plot coordinates {(1, 20) (2, 25) (3, 22.4) (4, 12.4)};
269 | \addplot plot coordinates {(1, 18) (2, 24) (3, 23.5) (4, 13.2)};
270 | \addplot plot coordinates {(1, 10) (2, 19) (3, 25) (4, 15.2)};
271 |
272 | \legend{lorem, ipsum, dolor}
273 |
274 | \end{axis}
275 | \end{tikzpicture}
276 | \end{figure}
277 | \end{frame}
278 | \begin{frame}{Quotes}
279 | \begin{quote}
280 | Veni, Vidi, Vici
281 | \end{quote}
282 | \end{frame}
283 |
284 | {%
285 | \setbeamertemplate{frame footer}{My custom footer}
286 | \begin{frame}[fragile]{Frame footer}
287 | \themename defines a custom beamer template to add a text to the footer. It can be set via
288 | \begin{verbatim}\setbeamertemplate{frame footer}{My custom footer}\end{verbatim}
289 | \end{frame}
290 | }
291 |
292 | \begin{frame}{References}
293 | Some references to showcase [allowframebreaks] \cite{knuth92,ConcreteMath,Simpson,Er01,greenwade93}
294 | \end{frame}
295 |
296 | \section{Conclusion}
297 |
298 | \begin{frame}{Summary}
299 |
300 | Get the source of this theme and the demo presentation from
301 |
302 | \begin{center}\url{github.com/matze/mtheme}\end{center}
303 |
304 | The theme \emph{itself} is licensed under a
305 | \href{http://creativecommons.org/licenses/by-sa/4.0/}{Creative Commons
306 | Attribution-ShareAlike 4.0 International License}.
307 |
308 | \begin{center}\ccbysa\end{center}
309 |
310 | \end{frame}
311 |
312 | \begin{frame}[standout]
313 | Questions?
314 | \end{frame}
315 |
316 | \appendix
317 |
318 | \begin{frame}[fragile]{Backup slides}
319 | Sometimes, it is useful to add slides at the end of your presentation to
320 | refer to during audience questions.
321 |
322 | The best way to do this is to include the \verb|appendixnumberbeamer|
323 | package in your preamble and call \verb|\appendix| before your backup slides.
324 |
325 | \themename will automatically turn off slide numbering and progress bars for
326 | slides in the appendix.
327 | \end{frame}
328 |
329 | \begin{frame}[allowframebreaks]{References}
330 |
331 | \bibliography{demo}
332 | \bibliographystyle{abbrv}
333 |
334 | \end{frame}
335 |
336 | \end{document}
337 |
--------------------------------------------------------------------------------
/demo/logo.eps:
--------------------------------------------------------------------------------
1 | %!PS-Adobe-3.0 EPSF-3.0
2 | %%Creator: cairo 1.14.0 (http://cairographics.org)
3 | %%CreationDate: Wed Jun 24 11:33:35 2015
4 | %%Pages: 1
5 | %%DocumentData: Clean7Bit
6 | %%LanguageLevel: 2
7 | %%BoundingBox: 0 -1 518 784
8 | %%EndComments
9 | %%BeginProlog
10 | save
11 | 50 dict begin
12 | /q { gsave } bind def
13 | /Q { grestore } bind def
14 | /cm { 6 array astore concat } bind def
15 | /w { setlinewidth } bind def
16 | /J { setlinecap } bind def
17 | /j { setlinejoin } bind def
18 | /M { setmiterlimit } bind def
19 | /d { setdash } bind def
20 | /m { moveto } bind def
21 | /l { lineto } bind def
22 | /c { curveto } bind def
23 | /h { closepath } bind def
24 | /re { exch dup neg 3 1 roll 5 3 roll moveto 0 rlineto
25 | 0 exch rlineto 0 rlineto closepath } bind def
26 | /S { stroke } bind def
27 | /f { fill } bind def
28 | /f* { eofill } bind def
29 | /n { newpath } bind def
30 | /W { clip } bind def
31 | /W* { eoclip } bind def
32 | /BT { } bind def
33 | /ET { } bind def
34 | /pdfmark where { pop globaldict /?pdfmark /exec load put }
35 | { globaldict begin /?pdfmark /pop load def /pdfmark
36 | /cleartomark load def end } ifelse
37 | /BDC { mark 3 1 roll /BDC pdfmark } bind def
38 | /EMC { mark /EMC pdfmark } bind def
39 | /cairo_store_point { /cairo_point_y exch def /cairo_point_x exch def } def
40 | /Tj { show currentpoint cairo_store_point } bind def
41 | /TJ {
42 | {
43 | dup
44 | type /stringtype eq
45 | { show } { -0.001 mul 0 cairo_font_matrix dtransform rmoveto } ifelse
46 | } forall
47 | currentpoint cairo_store_point
48 | } bind def
49 | /cairo_selectfont { cairo_font_matrix aload pop pop pop 0 0 6 array astore
50 | cairo_font exch selectfont cairo_point_x cairo_point_y moveto } bind def
51 | /Tf { pop /cairo_font exch def /cairo_font_matrix where
52 | { pop cairo_selectfont } if } bind def
53 | /Td { matrix translate cairo_font_matrix matrix concatmatrix dup
54 | /cairo_font_matrix exch def dup 4 get exch 5 get cairo_store_point
55 | /cairo_font where { pop cairo_selectfont } if } bind def
56 | /Tm { 2 copy 8 2 roll 6 array astore /cairo_font_matrix exch def
57 | cairo_store_point /cairo_font where { pop cairo_selectfont } if } bind def
58 | /g { setgray } bind def
59 | /rg { setrgbcolor } bind def
60 | /d1 { setcachedevice } bind def
61 | %%EndProlog
62 | %%BeginSetup
63 | %%EndSetup
64 | %%Page: 1 1
65 | %%BeginPageSetup
66 | %%PageBoundingBox: 0 -1 518 784
67 | %%EndPageSetup
68 | q 0 -1 518 785 rectclip q
69 | 0.137255 0.215686 0.231373 rg
70 | 0 527.921 m 0 783.578 l 517.574 783.578 l 517.574 478.808 l 452.461 462.206
71 | l 451.93 547.921 l 451.93 547.921 457.473 531.105 464.133 534.042 c 468.656
72 | 536.035 463.938 525.749 463.938 525.749 c 463.938 525.749 469.383 521.531
73 | 467.723 518.847 c 465.543 515.328 465.305 508.917 467.266 502.097 c 469.227
74 | 495.273 471.566 494.613 468.008 483.21 c 464.449 471.804 488.176 467.48
75 | 488.176 478.078 c 488.176 488.675 489.07 535.355 489.07 535.355 c 483.004
76 | 538.531 457.035 551.8 451.93 551.8 c 446.195 551.8 412.195 538.874 412.195
77 | 538.874 c 410.906 452.023 l 364.344 439.273 l 363.973 495.074 l 349.852
78 | 507.558 l 347.711 529.074 l 330.578 540.164 l 330.578 540.164 331.516 641.015
79 | 330.578 644.179 c 329.641 647.343 268.844 705.074 266.574 707.343 c 264.309
80 | 709.609 262.387 709.476 257.984 705.206 c 254.641 701.964 197.914 648.144
81 | 197.914 648.144 c 196.973 540.273 l 187.508 532.675 l 187.508 532.675 182.527
82 | 532.792 181.484 530.8 c 180.441 528.808 179.961 508.406 179.961 508.406
83 | c 166.309 495.339 l 166.309 495.339 166.641 522.378 166.18 530.8 c 164.039
84 | 540.14 166.441 557.609 164.574 560.14 c 162.707 562.675 140.809 572.675
85 | 138.309 573.874 c 134.973 575.476 111.664 574.316 108.863 573.382 c 106.062
86 | 572.449 86.809 559.519 86.809 559.519 c 86.809 559.519 86.305 518.941 87.641
87 | 505.339 c 88.973 491.742 86.98 487.609 85.91 486.675 c 84.84 485.742 0
88 | 527.921 0 527.921 c h
89 | 0 527.921 m f
90 | 108.309 326.406 m 109.41 530.406 l 109.41 530.406 102.812 471.316 104.312
91 | 465.917 c 105.812 460.515 103.344 442.23 103.711 437.007 c 104.551 425.035
92 | 103.477 424.945 102.91 417.507 c 102.41 410.941 104.574 408.074 102.809
93 | 403.706 c 100.992 399.206 98.512 346.007 100.109 326.406 c h
94 | 122.707 326.406 m 138.309 326.406 l 138.309 326.406 135.875 388.531 135.793
95 | 395.824 c 135.707 403.121 136.02 524.55 136.02 524.55 c 134.652 562.746
96 | l 134.652 562.746 131.117 542.335 131.688 536.863 c 132.258 531.39 132.828
97 | 535.496 133.625 529.906 c 134.426 524.32 133.012 441.128 131.574 433.906
98 | c 130.133 426.683 129.059 403.796 128.84 381.23 c 128.699 366.753 126.898
99 | 358.882 128.383 349.308 c 130.328 336.738 122.707 326.406 122.707 326.406
100 | c h
101 | 151.508 326.406 m 151.508 326.406 163.109 344.206 163.109 356.007 c 163.109
102 | 486.007 l 163.109 486.007 157.531 474.042 157.309 468.808 c 157.086 463.574
103 | 156.91 458.609 156.508 452.808 c 156.109 447.007 153.109 441.406 150.707
104 | 425.206 c 148.309 409.007 151.309 405.949 149.109 390.777 c 146.91 375.609
105 | 146.707 373.808 149.109 360.808 c 151.508 347.808 151.508 326.406 151.508
106 | 326.406 c h
107 | 168.508 326.406 m 179.707 326.406 l 179.707 503.007 l 176.91 500.808 l
108 | 176.91 500.808 176.309 450.007 176.109 422.007 c 175.91 394.007 177.707
109 | 385.406 175.707 381.406 c 173.707 377.406 174.109 371.206 174.109 371.206
110 | c 174.109 371.206 173.508 363.609 173.109 354.007 c 172.707 344.406 168.508
111 | 326.406 168.508 326.406 c h
112 | 190.109 326.406 m 197.309 326.406 l 196.91 454.007 l 194.469 455.886 l
113 | 194.469 455.886 195.297 411.222 195.098 406.624 c 194.895 402.023 194.699
114 | 394.062 193.707 389.824 c 191.523 380.488 193.812 349.941 191.508 345.41
115 | c 189.203 340.874 189.52 338.242 189.457 334.355 c 189.391 330.468 190.109
116 | 326.406 190.109 326.406 c h
117 | 263.637 326.406 m 265.293 475.757 l 265.293 475.757 267.668 472.66 267.801
118 | 463.574 c 267.91 455.886 276.129 447.199 278.188 435.464 c 279.547 427.714
119 | 280.805 417.371 286.125 408.019 c 289.242 402.539 289.371 392.187 288.633
120 | 388.507 c 287.891 384.831 288.207 384.554 289.008 381.206 c 289.727 378.226
121 | 287.777 376.472 289.742 372.933 c 291.742 369.331 292.707 371.007 297.039
122 | 363.706 c 301.98 355.374 296.109 359.808 305.637 347.503 c 307.781 344.73
123 | 306.207 341.906 305.508 336.706 c 304.719 330.843 308.941 326.41 308.941
124 | 326.41 c 263.637 326.41 l h
125 | 328.109 326.406 m 338.309 326.406 l 338.309 326.406 338.043 337.874 337.109
126 | 342.007 c 336.176 346.14 336.203 364.953 337.012 368.804 c 337.816 372.66
127 | 334.246 380.738 335.375 385.609 c 336.574 390.777 335.871 393.605 335.25
128 | 401.98 c 334.84 407.542 334.309 423.406 334.309 423.406 c 334.309 423.406
129 | 334.449 471.671 333.211 471.206 c 331.969 470.742 330.934 471.828 330.711
130 | 466.206 c 330.484 460.585 331.996 402.706 330.797 386.706 c 329.891 374.621
131 | 330.555 355.859 330.977 349.074 c 331.398 342.289 330.441 338.007 328.109
132 | 326.406 c h
133 | 347.109 326.406 m 354.043 326.406 l 354.043 326.406 354.707 345.206 354.43
134 | 349.179 c 354.266 351.566 352.852 351.371 352.707 355.609 c 352.566 359.843
135 | 354.141 359.835 354.707 365.703 c 355.543 374.402 354.23 382.23 354.574
136 | 388.675 c 354.883 394.414 355.152 402.597 353.242 406.273 c 351.328 409.949
137 | 352.441 414.808 352.441 414.808 c 351.105 451.074 l 351.105 451.074 348.113
138 | 433.425 348.648 413.867 c 349.387 386.714 348.199 355.527 348.586 351.171
139 | c 349.676 338.894 347.109 326.406 347.109 326.406 c h
140 | 394.508 378.007 m 411.109 367.808 l 411.109 367.808 412.039 349.789 411.207
141 | 344.214 c 411.055 343.187 397.652 347.46 394.91 355.523 c 393.332 360.167
142 | 394.508 378.007 394.508 378.007 c h
143 | 393.574 389.089 m 393.574 389.089 393.109 402.609 393.91 406.007 c 394.707
144 | 409.406 404.422 420.136 406.02 421.136 c 407.621 422.136 407.844 420.734
145 | 408.707 421.605 c 409.574 422.48 409.859 423.019 411.551 423.808 c 413.246
146 | 424.593 413.398 423.195 413.574 421.89 c 413.738 420.664 412.844 414.593
147 | 412.426 410.589 c 411.879 405.351 411.633 400.515 411.551 395.687 c 411.473
148 | 390.859 411.551 378.007 411.551 378.007 c h
149 | 393.574 389.089 m f
150 | 67.367 227.956 m 59.621 227.956 l 57.223 257.003 l 56.301 267.054 55.562
151 | 277.937 55.473 283.285 c 41.176 235.242 l 33.707 235.242 l 18.77 283.374
152 | l 18.68 276.183 18.125 265.949 17.297 256.542 c 15.082 227.956 l 7.523
153 | 227.956 l 12.871 291.398 l 23.75 291.398 l 37.676 244.464 l 50.953 291.398
154 | l 61.836 291.398 l h
155 | 115.688 284.941 m 90.699 284.941 l 90.699 263.55 l 112.367 263.55 l 112.367
156 | 257.093 l 90.699 257.093 l 90.699 234.41 l 117.258 234.41 l 117.258 227.956
157 | l 82.77 227.956 l 82.77 291.398 l 116.609 291.398 l 115.691 284.941 l h
158 | 166.039 284.574 m 148.242 284.574 l 148.242 227.956 l 140.312 227.956 l
159 | 140.312 284.574 l 122.055 284.574 l 122.055 291.398 l 166.961 291.398 l
160 | h
161 | 194.348 255.249 m 183.836 255.249 l 183.836 227.956 l 175.906 227.956 l
162 | 175.906 291.398 l 192.227 291.398 l 207.902 291.398 216.02 285.312 216.02
163 | 273.601 c 216.02 264.562 211.223 259.308 202.188 256.632 c 219.34 227.956
164 | l 209.84 227.956 l h
165 | 193.148 261.429 m 202.277 261.429 207.535 264.839 207.535 273.601 c 207.535
166 | 281.621 202.926 285.124 192.133 285.124 c 183.836 285.124 l 183.836 261.429
167 | l h
168 | 277.895 259.585 m 277.895 238.652 267.199 226.851 251.34 226.851 c 235.57
169 | 226.851 224.781 238.285 224.781 259.492 c 224.781 280.425 235.66 292.503
170 | 251.34 292.503 c 267.105 292.503 277.895 280.976 277.895 259.585 c h
171 | 233.266 259.492 m 233.266 241.05 240.641 233.488 251.336 233.488 c 262.402
172 | 233.488 269.41 241.05 269.41 259.585 c 269.41 278.121 262.496 285.867 251.336
173 | 285.867 c 240.457 285.867 233.266 278.117 233.266 259.492 c h
174 | 331.746 271.941 m 331.746 257.464 321.328 251.562 307.402 251.562 c 299.105
175 | 251.562 l 299.105 227.956 l 291.176 227.956 l 291.176 291.398 l 307.402
176 | 291.398 l 322.527 291.398 331.746 285.218 331.746 271.941 c h
177 | 323.266 271.847 m 323.266 281.621 317.086 285.124 307.312 285.124 c 299.105
178 | 285.124 l 299.105 257.925 l 307.129 257.925 l 316.812 257.925 323.266 260.874
179 | 323.266 271.847 c h
180 | 392.055 259.585 m 392.055 238.652 381.359 226.851 365.5 226.851 c 349.73
181 | 226.851 338.941 238.285 338.941 259.492 c 338.941 280.425 349.824 292.503
182 | 365.5 292.503 c 381.266 292.503 392.055 280.976 392.055 259.585 c h
183 | 347.426 259.492 m 347.426 241.05 354.801 233.488 365.5 233.488 c 376.566
184 | 233.488 383.57 241.05 383.57 259.585 c 383.57 278.121 376.656 285.867 365.5
185 | 285.867 c 354.617 285.867 347.426 278.117 347.426 259.492 c h
186 | 413.266 234.964 m 439.453 234.964 l 438.531 227.956 l 405.336 227.956 l
187 | 405.336 291.398 l 413.266 291.398 l h
188 | 457.344 227.956 m 449.414 227.956 l 449.414 291.398 l 457.344 291.398 l
189 | h
190 | 509.352 285.218 m 505.02 280.331 l 500.223 284.206 495.797 285.867 490.449
191 | 285.867 c 483.719 285.867 478.645 282.636 478.645 276.456 c 478.645 270.835
192 | 481.32 268.16 492.754 264.656 c 503.176 261.519 511.383 257.464 511.383
193 | 245.566 c 511.383 234.503 503.082 226.847 489.156 226.847 c 480.121 226.847
194 | 473.113 229.89 467.859 234.964 c 472.375 240.035 l 477.078 235.98 482.059
195 | 233.488 489.066 233.488 c 496.812 233.488 503.082 237.453 503.082 245.289
196 | c 503.082 251.839 499.945 254.695 489.066 258.015 c 476.617 261.796 470.438
197 | 266.499 470.438 276.179 c 470.438 285.679 478.555 292.503 490.078 292.503
198 | c 498.746 292.499 504.188 289.917 509.352 285.214 c h
199 | 509.352 285.218 m f
200 | 374.285 326.406 m 361.91 326.406 l 361.91 326.406 363.109 419.808 362.707
201 | 423.206 c 362.309 426.609 367.285 428.808 370.098 428.808 c 372.91 428.808
202 | 380.82 427.898 382.309 428.808 c 383.797 429.718 388.711 432.406 391.91
203 | 432.406 c 395.109 432.406 399.758 432.355 406.719 433.206 c 413.676 434.058
204 | 416.109 434.609 423.109 434.808 c 430.109 435.007 436.508 433.609 441.91
205 | 434.007 c 447.309 434.406 446.711 437.535 449.109 438.472 c 451.508 439.406
206 | 452.309 438.335 454.711 439.273 c 457.109 440.206 458.309 442.808 462.711
207 | 443.609 c 467.109 444.406 474.91 453.206 477.508 453.206 c 480.109 453.206
208 | 491.816 460.206 500.91 461.808 c 510.004 463.406 517.574 462.808 517.574
209 | 462.808 c 517.574 456.007 l 517.574 456.007 494.91 457.609 477.109 441.609
210 | c 459.309 425.609 468.684 423.917 472.598 413.765 c 473.965 410.214 473.48
211 | 408.433 473.375 405.874 c 473.184 401.109 472.223 396.328 472.309 391.206
212 | c 472.445 383.343 470.445 373.742 471.512 369.41 c 472.578 365.074 469.777
213 | 366.14 469.711 362.007 c 469.645 357.874 473.562 354.792 473.309 349.206
214 | c 473.059 343.621 472.445 337.874 472.711 335.808 c 472.977 333.742 474.445
215 | 332.808 475.512 335.808 c 476.578 338.808 477.191 399.269 476.789 407.203
216 | c 476.391 415.136 475.777 430.675 483.645 436.941 c 490.52 442.421 494.176
217 | 445.206 499.91 447.609 c 505.641 450.007 507.738 448.218 506.711 444.007
218 | c 505.684 439.796 504.711 435.609 504.711 431.808 c 504.711 428.007 504.574
219 | 424.941 504.711 420.609 c 504.844 416.273 503.75 416.542 503.711 414.206
220 | c 503.645 410.273 505.777 411.609 507.508 411.808 c 509.242 412.007 510.574
221 | 411.074 511.309 407.609 c 512.043 404.14 512.445 351.804 511.867 348.253
222 | c 511.344 345.07 511.609 341.882 512.105 339.027 c 512.602 336.175 513.262
223 | 336.742 513.312 334.007 c 513.379 330.273 511.91 326.406 511.91 326.406
224 | c 490.312 326.406 l 490.312 326.406 489.91 346.007 488.512 352.808 c 487.812
225 | 356.206 488.621 365.605 488.844 376.808 c 489.07 388.011 488.711 401.023
226 | 488.711 401.023 c 488.445 425.074 l 488.445 425.074 488.445 438.675 486.91
227 | 437.007 c 485.379 435.343 484.312 428.609 484.312 428.609 c 484.312 428.609
228 | 482.977 421.874 482.512 415.808 c 482.043 409.742 485.246 407.906 484.711
229 | 401.023 c 484.176 394.14 480.977 394.675 481.91 385.609 c 482.844 376.542
230 | 483.512 366.808 483.512 363.007 c 483.512 359.21 485.207 360.019 485.109
231 | 356.21 c 485.016 352.398 484.312 344.007 484.711 340.21 c 485.109 336.41
232 | 485.246 335.476 485.512 332.609 c 485.777 329.742 484.711 326.41 484.711
233 | 326.41 c 464.711 326.41 l 464.711 326.41 464.312 402.144 464.312 405.41
234 | c 464.312 408.675 462.844 410.277 461.711 406.41 c 460.578 402.542 461.891
235 | 401.683 461.312 399.41 c 460.734 397.136 460.844 393.742 458.512 388.41
236 | c 456.176 383.074 457.312 326.41 457.312 326.41 c 389.711 326.41 l 389.711
237 | 326.41 391.574 330.906 392.031 335.636 c 392.523 340.749 392.523 341.546
238 | 393.312 346.41 c 393.59 348.136 398.176 335.742 404.512 331.609 c 409.23
239 | 328.531 414.043 326.8 422.312 326.996 c 430.93 327.199 439.562 331.433
240 | 440.312 333.609 c 441.777 337.874 441.512 419.078 440.512 422.41 c 439.512
241 | 425.742 428.441 431.14 416.91 430.808 c 398.312 430.277 382.164 414.792
242 | 381.965 404.273 c 381.73 391.824 380.445 389.078 379.711 381.011 c 378.977
243 | 372.945 374.289 369.476 374.289 359.808 c 374.289 326.41 l h
244 | 0 195.578 m 0 123.48 148.203 29.558 258.531 -0.001 c 368.859 29.558 517.059
245 | 123.48 517.059 195.578 c h
246 | 197.805 131.484 m 185.836 131.484 l 185.836 93.417 l 180.504 93.417 l 180.504
247 | 131.484 l 168.23 131.484 l 168.23 136.074 l 198.422 136.074 l h
248 | 233.203 93.417 m 227.812 93.417 l 227.812 113.628 l 209.273 113.628 l 209.273
249 | 93.417 l 203.941 93.417 l 203.941 136.074 l 209.273 136.074 l 209.273 118.093
250 | l 227.812 118.093 l 227.812 136.074 l 233.203 136.074 l h
251 | 267.551 93.417 m 244.363 93.417 l 244.363 136.074 l 267.117 136.074 l 266.496
252 | 131.734 l 249.695 131.734 l 249.695 117.347 l 264.266 117.347 l 264.266
253 | 113.011 l 249.695 113.011 l 249.695 97.757 l 267.551 97.757 l h
254 | 308.223 93.417 m 306.609 112.949 l 305.988 119.706 305.492 127.023 305.434
255 | 130.617 c 295.824 98.316 l 290.801 98.316 l 280.758 130.679 l 280.695 125.843
256 | 280.324 118.96 279.766 112.636 c 278.277 93.417 l 273.191 93.417 l 276.789
257 | 136.074 l 284.105 136.074 l 293.465 104.515 l 302.395 136.074 l 309.711
258 | 136.074 l 313.43 93.417 l h
259 | 346.473 93.417 m 323.289 93.417 l 323.289 136.074 l 346.039 136.074 l 345.422
260 | 131.734 l 328.621 131.734 l 328.621 117.347 l 343.188 117.347 l 343.188
261 | 113.011 l 328.621 113.011 l 328.621 97.757 l 346.477 97.757 l 346.477 93.417
262 | l h
263 | 346.473 93.417 m f
264 | Q Q
265 | showpage
266 | %%Trailer
267 | end restore
268 | %%EOF
269 |
--------------------------------------------------------------------------------
/demo/logo.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/matze/mtheme/2fa6084b9d34fec9d2d5470eb9a17d0bf712b6c8/demo/logo.pdf
--------------------------------------------------------------------------------
/demo/logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/doc/metropolistheme.dtx:
--------------------------------------------------------------------------------
1 | %% ---------------------------------------------------------------------------
2 | %% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
3 | %% contributors can be found at
4 | %%
5 | %% https://github.com/matze/mtheme/graphs/contributors
6 | %%
7 | %% and the original template was based on the HSRM theme by Benjamin Weiss.
8 | %%
9 | %% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
10 | %% International License (https://creativecommons.org/licenses/by-sa/4.0/).
11 | %% ---------------------------------------------------------------------------
12 |
13 | \documentclass{ltxdoc}
14 | %\OnlyDescription
15 |
16 | \usepackage{parskip}
17 | \usepackage{setspace}
18 | \usepackage{xspace}
19 | \onehalfspacing
20 |
21 | \usepackage{etoolbox}
22 | \usepackage{ifxetex}
23 | \usepackage{ifluatex}
24 |
25 | \ifboolexpr{bool {xetex} or bool {luatex}}{
26 | \usepackage{fontspec}
27 | \defaultfontfeatures{Ligatures=TeX}
28 |
29 | \newcounter{fontsnotfound}
30 | \newcommand{\checkfont}[1]{%
31 | \suppressfontnotfounderror=1%
32 | \font\x = "#1" at 10pt
33 | \selectfont
34 | \ifx\x\nullfont%
35 | \stepcounter{fontsnotfound}%
36 | \fi%
37 | \suppressfontnotfounderror=0%
38 | }
39 |
40 | \newcommand{\iffontsavailable}[3]{%
41 | \setcounter{fontsnotfound}{0}%
42 | \expandafter\forcsvlist\expandafter%
43 | \checkfont\expandafter{#1}%
44 | \ifnum\value{fontsnotfound}=0%
45 | #2%
46 | \else%
47 | #3%
48 | \fi%
49 | }
50 | \iffontsavailable{Fira Sans Light,%
51 | Fira Sans Light Italic,%
52 | Fira Sans,%
53 | Fira Sans Italic}{%
54 | \setmainfont[BoldFont={Fira Sans}]{Fira Sans Light}%
55 | }{%
56 | \iffontsavailable{Fira Sans Light OT,%
57 | Fira Sans Light Italic OT,%
58 | Fira Sans OT,%
59 | Fira Sans Italic OT}{%
60 | \setmainfont[BoldFont={Fira Sans OT}]{Fira Sans Light OT}%
61 | }{%
62 | \typeout{%
63 | Could not find Fira Sans fonts. Creating documentation%
64 | with standard fonts.%
65 | }
66 | }
67 | }
68 | \iffontsavailable{Fira Mono, Fira Mono Bold}{%
69 | \setmonofont{Fira Mono}%
70 | }{%
71 | \iffontsavailable{Fira Mono OT, Fira Mono Bold OT}{%
72 | \setmonofont{Fira Mono OT}%
73 | }{%
74 | \typeout{%
75 | Could not find Fira Sans fonts. Creating documentation%
76 | with standard monospaced fonts.%
77 | }
78 | }
79 | }
80 | }{
81 | \typeout{%
82 | You need to compile with XeLaTeX or LuaLaTeX to use the Fira fonts.%
83 | }
84 | }
85 |
86 | \usepackage{enumitem}
87 | \setlist[itemize]{noitemsep}
88 | \setlist[enumerate]{noitemsep}
89 |
90 | \usepackage{xcolor}
91 | \definecolor{mDarkBrown}{HTML}{604c38}
92 | \definecolor{mDarkTeal}{HTML}{23373b}
93 | \definecolor{mLightBrown}{HTML}{EB811B}
94 | \definecolor{mLightGreen}{HTML}{14B03D}
95 | \definecolor{mBackground}{HTML}{FFFFFF}
96 |
97 | \usepackage{listings}
98 | \lstset{%
99 | language=[LaTeX]{TeX},
100 | basicstyle=\ttfamily,
101 | keywordstyle=\color{mLightBrown}\bfseries,
102 | commentstyle=\color{mLightGreen},
103 | stringstyle=\color{mLightGreen},
104 | backgroundcolor=\color{mBackground},
105 | numbers=none,
106 | numberstyle=\tiny\ttfamily,
107 | stepnumber=2,
108 | showspaces=false,
109 | showstringspaces=false,
110 | showtabs=false,
111 | frame=none,
112 | framerule=1pt,
113 | tabsize=2,
114 | rulesep=5em,
115 | captionpos=b,
116 | breaklines=true,
117 | breakatwhitespace=false,
118 | framexleftmargin=0em,
119 | framexrightmargin=0em,
120 | xleftmargin=0em,
121 | xrightmargin=0em,
122 | aboveskip=1em,
123 | belowskip=1em,
124 | morekeywords={usetheme,institute,maketitle,@metropolis@titleformat,%
125 | plain,setbeamercolor,metroset,setsansfont,setmonofont},
126 | }
127 | \lstMakeShortInline|
128 | \usepackage{metalogo}
129 |
130 | \usepackage[colorlinks=true,
131 | linkcolor=mLightBrown,
132 | menucolor=mLightBrown,
133 | pagecolor=mLightBrown,
134 | urlcolor=mLightBrown]{hyperref}
135 |
136 | \newcommand{\DescribeOption}[4]{
137 | \DescribeMacro{#1}
138 | \begin{minipage}[t]{\textwidth}
139 | \textit{\textbf{\textcolor{mLightGreen}{#2}}}\dotfill\,#3\par
140 | \begingroup
141 | \vspace{0.5em}#4\par
142 | \endgroup
143 | \end{minipage}
144 | }
145 |
146 | \newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}
147 |
148 | \usepackage{readprov}
149 | \ReadPackageInfos{beamerthememetropolis}
150 |
151 | \title{Modern Beamer Presentations with the \themename package}
152 | \author{Matthias Vogelgesang \\ \url{matthias.vogelgesang@gmail.com}}
153 | \date{\fileversion~---~\filedate}
154 |
155 | \begin{document}
156 |
157 | \maketitle
158 | \tableofcontents
159 |
160 |
161 | \section{Introduction}
162 |
163 | Beamer is an awesome way to make presentations with LaTeX, but its theme
164 | selection is surprisingly sparse. The stock themes share an aesthetic that can
165 | be a little cluttered, while the few distinctive custom themes available are
166 | often specialized for a particular corporate or institutional brand.
167 |
168 | The goal of \themename is to provide a simple, modern Beamer theme suitable
169 | for anyone to use. It tries to minimize noise and maximize space for content;
170 | the only visual flourish it offers is an (optional) progress bar added to each
171 | slide or to the section slides.
172 |
173 | By default, \themename uses
174 | \href{https://www.mozilla.org/en-US/styleguide/products/firefox-os/typeface/}
175 | {Fira Sans}, a gorgeous typeface commissioned by Mozilla and designed by
176 | \href{http://www.carrois.com/fira-3-1/}{Carrois}. For best results, you will
177 | need the Fira typeface installed and use \XeLaTeX\ to typeset your slides.
178 | However, \themename can also be used with other typefaces and \LaTeX{} build
179 | systems.
180 |
181 | \themename's codebase is maintained on \href{https://github.com/matze/mtheme}
182 | {GitHub}. If you have issues, find mistakes in the manual or want to help make
183 | the theme even better, please get in touch there. The
184 | \href{https://github.com/matze/mtheme/graphs/contributors}
185 | {full list of contributors} already contains over a dozen names!
186 |
187 |
188 | \section{Getting Started}
189 |
190 | \subsection{Installing from CTAN}
191 |
192 | For most users, we recommend installing \themename from
193 | \href{https://www.ctan.org}{CTAN}. If you keep your \TeX\ distribution
194 | up-to-date, chances are good that \themename is already installed. If it is
195 | not, you need to update your packages. If your distribution is \TeX\ Live
196 | (or Mac\TeX\ on OS X), the following command updates all packages.
197 |
198 | \begin{lstlisting}
199 | tlmgr update --all
200 | \end{lstlisting}
201 |
202 | If this results in an error, you may need to run it with administrative privileges:
203 |
204 | \begin{lstlisting}
205 | sudo tlmgr update --all
206 | \end{lstlisting}
207 |
208 | Mac\TeX\ on OS X also provides a graphical interface for |tlmgr| called
209 | \TeX\ Live Utility.
210 |
211 | For any other distribution please refer to its documentation on how to update
212 | your packages.
213 |
214 | To get the most out of the theme you should also install the |Fira| fonts.
215 | However, this is not mandatory; \themename also works with the standard fonts.
216 |
217 |
218 | \subsection{Installing from GitHub}
219 |
220 | If you want to use the cutting-edge development version of \themename, you can
221 | install it manually. Like any \LaTeX\ package, this involves four easy steps:
222 | \begin{description}
223 | \item[Download the source] with a |git clone| of the
224 | \href{https://github.com/matze/mtheme}{\themename repository} or as a
225 | \href{https://github.com/matze/mtheme/archive/master.zip}{zip archive}
226 | of the latest development version.
227 |
228 | \item[Compile the style files] by running |make sty| inside the downloaded
229 | directory. (Or run \LaTeX{} directly on |source/metropolistheme.ins|.)
230 |
231 | \item[Move the resulting |*.sty| files] to the folder containing your
232 | presentation. To use \themename with many presentations, run
233 | |make install| or move the |*.sty| files to a folder in your \TeX{} path
234 | instead.
235 |
236 | \item[Use the theme for your presentation] by declaring
237 | |\usetheme{metropolis}| in the preamble of your Beamer document.
238 | \end{description}
239 |
240 | \themename uses the Make build system to offer the following installation
241 | options for advanced users:
242 |
243 | \begin{description}
244 | \item[|make sty|] builds the theme style files.
245 | \item[|make doc|] builds this documentation manual.
246 | \item[|make demo|] builds a demo presentation to test the features of
247 | \themename.
248 | \item[|make all|] builds the theme and manual.
249 | \item[|make clean|] removes the files generated by |make all|.
250 | \item[|make install|] installs the theme into your local texmf folder.
251 | \item[|make uninstall|] removes the theme from your local texmf folder.
252 | \end{description}
253 |
254 |
255 | \subsection{A Minimal Example}
256 |
257 | The following code shows a minimal example of a Beamer presentation using
258 | \themename.
259 |
260 | \begin{lstlisting}
261 | \documentclass{beamer}
262 | \usetheme{metropolis} % Use metropolis theme
263 | \title{A minimal example}
264 | \date{\today}
265 | \author{Matthias Vogelgesang}
266 | \institute{Centre for Modern Beamer Themes}
267 | \begin{document}
268 | \maketitle
269 | \section{First Section}
270 | \begin{frame}{First Frame}
271 | Hello, world!
272 | \end{frame}
273 | \end{document}
274 | \end{lstlisting}
275 |
276 |
277 | \subsection{Dependencies}
278 |
279 | \themename depends on the |beamer| class and the following standard packages:
280 | \begin{multicols}{3}
281 | \begin{itemize}
282 | \item |tikz|
283 | \item |pgfopts|
284 | \item |etoolbox|
285 | \item |calc|
286 | \item |ifxetex|
287 | \item |ifluatex|
288 | \end{itemize}
289 | \end{multicols}
290 |
291 | For best results, we recommend installing the fonts
292 | \href{https://github.com/mozilla/Fira}{|Fira Sans|} and |Fira Mono|
293 | and compiling with \themename using \XeLaTeX\ or \LuaTeX.
294 | These are optional dependencies; \themename is compatible with (e.g.)
295 | pdf\LaTeX\ and will fall back to standard fonts if |Fira Sans| or |Fira Mono|
296 | is not installed.
297 |
298 | The packaged name of |Fira Sans| is |Fira Sans OT| in some Linux
299 | distributions; this case is automatically handled by \themename.
300 |
301 |
302 | \subsection{Pandoc}
303 |
304 | To use this theme with \href{http://johnmacfarlane.net/pandoc/}{Pandoc}-based
305 | presentations, you can run the following command
306 |
307 | \begin{lstlisting}
308 | $ pandoc -t beamer --latex-engine=xelatex -V theme:metropolis -o output.pdf input.md
309 | \end{lstlisting}
310 |
311 |
312 | \section{Customization}
313 |
314 | \subsection{Package options}
315 |
316 | The theme provides a number of options, which can be set using a key=value
317 | interface. The primary way to set options is to provide a comma-separated list
318 | of option-value pairs when loading \themename in the preamble:
319 | \begin{lstlisting}
320 | \usetheme[option1=value1, option2=value2, ...]{metropolis}
321 | \end{lstlisting}
322 |
323 | Options can be changed at any time --- even mid-presentation! --- with the
324 | |\metroset| macro.
325 | \begin{lstlisting}
326 | \metroset{option1=newvalue1, option2=newvalue2, ...}
327 | \end{lstlisting}
328 |
329 | The list of options is structured as shown in the following example.
330 |
331 | \DescribeOption{option key}{list of possible values}{default}{
332 | A short description of the option.
333 | }
334 |
335 |
336 | \subsubsection{Main theme}
337 |
338 | \DescribeOption{titleformat}%
339 | {regular, smallcaps, allsmallcaps, allcaps}
340 | {regular}{
341 | Changes the format of titles, subtitles, section titles, frame titles, and
342 | the text on ``standout'' frames. The available options produce
343 | Regular, \textsc{SmallCaps}, \textsc{\MakeLowercase{AllSmallCaps}}, or
344 | \MakeUppercase{AllCaps} titles. Please refer to
345 | Section~\ref{sec:titleformats} for known issues with these options.
346 | }
347 |
348 | \DescribeOption{titleformat plain}%
349 | {regular, smallcaps, allsmallcaps, allcaps}%
350 | {regular}{
351 | Changes the format of ``standout'' frames (see |titleformat|, above).
352 | }
353 |
354 |
355 | \subsubsection{Inner theme}
356 |
357 | \DescribeOption{sectionpage}{none, simple, progressbar}{progressbar}{
358 | Adds a slide at the start of each section (|simple|) with an optional thin
359 | progress bar below the section title (|progressbar|). The |none| option
360 | disables the section page.
361 | }
362 |
363 | \DescribeOption{subsectionpage}{none, simple, progressbar}{none}{
364 | Optionally adds a slide at the start of each subsection. If enabled with
365 | the |simple| or |progressbar| options, the style of the |section page| will
366 | be updated to match the style of the |subsection page|. Note that section
367 | slides and subsection slides can appear consecutively if both are enabled;
368 | you may want to use this option together with |sectionpage=none| depending
369 | on the section structure of your presentation.
370 | }
371 |
372 |
373 | \subsubsection{Outer theme}
374 |
375 | \DescribeOption{numbering}{none, counter, fraction}{counter}{
376 | Controls whether the frame number at the bottom right of each slide is
377 | omitted (|none|), shown (|counter|) or displayed as a fraction of the total
378 | number of frames (|fraction|).
379 | }
380 |
381 | \DescribeOption{progressbar}{none, head, frametitle, foot}{none}{
382 | Optionally adds a progress bar to the top of each frame (|head|),
383 | the bottom of each frame (|foot|), or directly below each frame title
384 | (|frametitle|).
385 | }
386 |
387 | \subsubsection{Color theme}
388 | \DescribeOption{block}{transparent, fill}{transparent}{
389 | Optionally adds a light grey background to block environments like |theorem|
390 | and |example|.
391 | }
392 |
393 | \DescribeOption{background}{dark, light}{light}{
394 | Provides the option to have a dark background and light foreground instead
395 | of the reverse.
396 | }
397 |
398 |
399 | \subsubsection{Font theme}
400 |
401 | \DescribeMacro{titleformat title}
402 | \DescribeMacro{titleformat subtitle}
403 | \DescribeMacro{titleformat section}
404 | \DescribeOption{titleformat frame}%
405 | {regular, smallcaps, allsmallcaps, allcaps}%
406 | {regular}{
407 | Individually controls the format of titles, subtitles, section titles, and
408 | frame titles (see |titleformat|, above).
409 | }
410 |
411 |
412 | \subsection{Color Customization}
413 |
414 | The included \themename color theme is used by default, but its colors can be
415 | easily changed to suit your tastes. All of the theme's styles are defined in
416 | terms of three beamer colors:
417 | \begin{itemize}
418 | \item |normal text| (dark fg, light bg)
419 | \item |alerted text| (colored fg, should be visible against dark or light)
420 | \item |example text| (colored fg, should be visible against dark or light)
421 | \end{itemize}
422 |
423 | An easy way to customize the theme is to redefine these colors using
424 |
425 | \begin{lstlisting}
426 | \setbeamercolor{ ... }{ fg= ... , bg= ... }
427 | \end{lstlisting}
428 | in your preamble. For greater customization, you can redefine any of the other
429 | stock beamer colors. In addition to the stock colors the theme defines a number
430 | of \themename specific colors, which can also be redefined to your liking.
431 |
432 | \begin{lstlisting}
433 | \setbeamercolor{progress bar}{ ... }
434 | \setbeamercolor{title separator}{ ... }
435 | \setbeamercolor{progress bar in head/foot}{ ... }
436 | \setbeamercolor{progress bar in section page}{ ... }
437 | \end{lstlisting}
438 |
439 | For low-light situations \themename it might be helpful to use the
440 | |metropolis-highcontrast| color theme. It is enabled like any other color theme:
441 |
442 | \begin{lstlisting}
443 | \usecolortheme{metropolis-highcontrast}
444 | \end{lstlisting}
445 |
446 |
447 | \subsection{Font Customization}
448 |
449 | The default font for \themename is |Fira|. This can be easily changed using
450 | the standard font selection commands of the \textsf{fontspec} package. So if
451 | you prefer, for example, the \href{http://font.ubuntu.com}{|Ubuntu|} font family, just add the following two commands after loading the \themename theme.
452 |
453 | \begin{lstlisting}
454 | \setsansfont{Ubuntu}
455 | \setmonofont{Ubuntu Mono}
456 | \end{lstlisting}
457 |
458 | If you are expecting to present in a large room or with an underpowered
459 | projector, you may want to change the font to a heavier weight of Fira to
460 | maximize readability.
461 |
462 | \begin{lstlisting}
463 | \setsansfont[BoldFont={Fira Sans SemiBold}]{Fira Sans Book}
464 | \end{lstlisting}
465 |
466 |
467 | \subsubsection{Old style figures}
468 |
469 | The regular \textsf{fontspec} mechanism for changing glyph appearance applies
470 | also to this theme. If you want to have old style figures in the text but
471 | regular lined figures for math, you could add the following to your preamble:
472 |
473 | \begin{lstlisting}
474 | \usefonttheme{professionalfonts} % required for mathspec
475 | \usepackage{mathspec}
476 | \setsansfont[BoldFont={Fira Sans},
477 | Numbers={OldStyle}]{Fira Sans Light}
478 | \setmathsfont(Digits)[Numbers={Lining, Proportional}]{Fira Sans Light}
479 | \end{lstlisting}
480 |
481 |
482 | \subsection{Commands}
483 |
484 | \subsubsection{Standout frames}
485 |
486 | The \themename inner theme offers a custom frame format with large, centered
487 | text and an inverted background --- perfect for focusing attention on
488 | single sentence or image. To use it, add the key |standout| to the frame:
489 |
490 | \begin{lstlisting}
491 | \begin{frame}[standout]
492 | Thank you!
493 | \end{frame}
494 | \end{lstlisting}
495 |
496 |
497 |
498 | \section{\texttt{pgfplots} integration}
499 |
500 | \themename comes with a set of pre-defined pgfplots styles and a color theme
501 | based on Paul Tol's color scheme.
502 |
503 |
504 | \subsection{Styles}
505 |
506 | Pass the following style keys to the axis environment to get the appropriate
507 | effect:
508 |
509 | \begin{macro}{mlineplot}
510 | Plot regular line charts with reduced axis frames, less intrusive legend and
511 | subdued grid.
512 | \end{macro}
513 | \begin{macro}{mbarplot}
514 | Plot vertical bar charts in a similar way as |mlineplot| but reduce grid usage.
515 | \end{macro}
516 | \begin{macro}{horizontal mbarplot}
517 | Plot horizontal bar charts.
518 | \end{macro}
519 | \begin{macro}{disable thousands separator}
520 | Helper style to remove thousands separator.
521 | \end{macro}
522 |
523 |
524 | \subsection{Paul Tol colors}
525 |
526 | A good presentation uses colors that are distinct from each other as much as
527 | possible as well as from black and white, can be discerned item under different
528 | lighting and display environments and by color-blind viewers, while matching
529 | well together.
530 |
531 | In a \href{https://personal.sron.nl/~pault/data/colourschemes.pdf}{technical note}
532 | for SRON, Paul Tol proposed a palette of colors satisfying these constraints.
533 | The sub-package |pgfplotsthemetol| defines palettes for |pgfplots| charts
534 | based on Tol's work.
535 |
536 |
537 | \section{Tips \& Tricks}
538 |
539 | \subsection{Backup Slides}
540 |
541 | Speakers will often include extra slides at the end of their presentation to
542 | refer to during audience questions. One easy way to do this is to include the
543 | \verb|appendixnumberbeamer| package in your preamble and call \verb|\appendix| before your backup slides.
544 |
545 | \themename will automatically turn off slide numbering and progress bars for
546 | slides in the appendix.
547 |
548 |
549 | \section{Known Issues}
550 |
551 | \subsection{Title formats}
552 | \label{sec:titleformats}
553 |
554 | Be aware that not every font supports small caps, so the |smallcaps| or
555 | |allsmallcaps| options may not work if you use a font other than |Fira Sans|.
556 | In particular, the Computer Modern sans-serif typeface, which is used when
557 | \themename is compiled with pdf\LaTeX, does not have a small-caps variant.
558 |
559 | The title format options |allsmallcaps| and |allcaps| are quite nice from an
560 | aesthetic point of view, but their use of |\MakeLowercase| and
561 | |\MakeUppercase| can cause unexpected problems. For example:
562 |
563 | \begin{itemize}
564 | \item Some commands, like |\\|, do not work inside |\MakeLowercase| and
565 | |\MakeUppercase|. (See \href{https://github.com/matze/mtheme/issues/125}
566 | {\#125})
567 | \item Only alphabetic characters are affected by |\MakeLowercase|, so
568 | numerals and punctuation remain at full height. This can spoil some of the
569 | aesthetic benefits of |allsmallcaps|. (See
570 | \href{https://github.com/matze/mtheme/issues/33}{\#33})
571 | \item |\MakeLowercase| and |\MakeUppercase| apply to math mode and
572 | |\scshape| does not. This can easily introduce mathematical errors that
573 | are hard to catch.
574 | \item It is impossible to typeset symbols which are encoded as uppercase
575 | letters in a different font. In particular, |\mathbb| and |\mathcal|
576 | letters will be replaced by other math glyphs. (See
577 | \href{https://github.com/matze/mtheme/issues/153}{\#153})
578 | \end{itemize}
579 |
580 | The |allsmallcaps| and |allcaps| options are safe to use if your titles contain
581 | only alphabetic characters and do not require the expansion of any macros.
582 |
583 |
584 | \subsection{Interactions with other color themes}
585 |
586 | \themename can be used along with any other Beamer color theme, such as
587 | |crane| or |seahorse|. If you wish to do this, it is usually best to include
588 | the \themename subpackages individually so the \themename color theme is
589 | never loaded. This will prevent conflicts between the \themename color theme
590 | and your preferred theme.
591 |
592 | For example, overriding the color theme as follows may not work as expected because |\usetheme{metropolis}| loads the \themename color theme, which
593 | defines a relationship between the frametitle background and the primary
594 | palette of the theme. Since |seahorse| assumes a different relationship
595 | between its palettes, the result is a grey, rather than periwinkle,
596 | frametitle background.
597 |
598 | \begin{lstlisting}
599 | \usetheme{metropolis}
600 | \usecolortheme{seahorse}
601 | \end{lstlisting}
602 |
603 | The correct colors are chosen if the \themename outer, inner, and font themes
604 | are loaded seperately:
605 |
606 | \begin{lstlisting}
607 | \useoutertheme{metropolis}
608 | \useinnertheme{metropolis}
609 | \usefonttheme{metropolis}
610 | \usecolortheme{seahorse} % or your preferred color theme
611 | \end{lstlisting}
612 |
613 | Please note that \themename may not use all the colors defined in your
614 | favourite Beamer color theme. In particular, \themename does not set a
615 | background color for the title; this will cause issues when using color themes
616 | like |whale| which set a white foreground for the title.
617 |
618 |
619 | \subsection{Notes on second screen}
620 |
621 | If you use the |[show notes on second screen]| option built in to Beamer and
622 | compile with \XeLaTeX, text on slides following the first section slide may
623 | be rendered in white instead of the regular colour. This is due to
624 | \href{http://tex.stackexchange.com/questions/288408/}{a bug} in Beamer
625 | or \XeLaTeX\ itself. You can work around it either by compiling with \LuaTeX\
626 | or by adding the following code to your preamble to reset the text color
627 | on each slide.
628 |
629 | \begin{lstlisting}
630 | \makeatletter
631 | \def\beamer@framenotesbegin{% at beginning of slide
632 | \usebeamercolor[fg]{normal text}
633 | \gdef\beamer@noteitems{}%
634 | \gdef\beamer@notes{}%
635 | }
636 | \makeatother
637 | \end{lstlisting}
638 |
639 |
640 | \subsection{Standout frames with labels}
641 |
642 | Because the |standout| frame option creates a group to restrict the colour
643 | change to a single slide, labels defined after calling |standout| will stay
644 | local to the group. In other words, the following may result in a ``label undefined'' error.
645 |
646 | \begin{lstlisting}
647 | \begin{frame}[standout, label=conclusion]{Conclusion}
648 | Awesome slide
649 | \end{frame}
650 | \end{lstlisting}
651 |
652 | To fix this problem, change the order of the keys in the frame.
653 |
654 | \begin{lstlisting}
655 | \begin{frame}[label=conclusion, standout]{Conclusion}
656 | Awesome slide
657 | \end{frame}
658 | \end{lstlisting}
659 |
660 | This error can be unwittingly triggered if you export your slides from Emacs
661 | Org mode, which automatically adds labels after frame options. Alex Branham
662 | \href{https://github.com/matze/mtheme/issues/203}{offers} the following
663 | solution for Org mode users, using |org-set-property|.
664 |
665 | \begin{lstlisting}
666 | * Start of a frame
667 | :PROPERTIES:
668 | :BEAMER_opt: label=conclusion,standout
669 | :END:
670 | \end{lstlisting}
671 |
672 |
673 | \subsection{Standout frames with Pandoc}
674 |
675 | With Pandoc versions prior 1.17.2 it was not possible to create standout frames
676 | because Pandoc only supported a specific list of frame attributes thus ignoring
677 | additional attributes such as |{.standout}|.
678 |
679 |
680 | \section{License}
681 |
682 | \themename is licensed under a
683 | \href{http://creativecommons.org/licenses/by-sa/4.0/}{Creative Commons
684 | Attribution-ShareAlike 4.0 International License}.
685 | This means that if you change the theme and re-distribute it, you must retain
686 | the copyright notice header and license it under the same CC-BY-SA license.
687 | This does not affect any presentations that you create with the theme.
688 |
689 |
690 | \section{Implementation}
691 |
692 | \DocInput{beamerthememetropolis.dtx}
693 | \DocInput{beamerinnerthememetropolis.dtx}
694 | \DocInput{beamerouterthememetropolis.dtx}
695 | \DocInput{beamerfontthememetropolis.dtx}
696 | \DocInput{beamercolorthememetropolis.dtx}
697 | \DocInput{pgfplotsthemetol.dtx}
698 |
699 | \end{document}
700 |
--------------------------------------------------------------------------------
/docker/Dockerfile:
--------------------------------------------------------------------------------
1 |
2 | ## Contributed by Walter Schulze (@awalterschulze)
3 | ## Simplified by Dirk Eddelbuettel (@eddelbuettel)
4 |
5 | FROM ubuntu:trusty
6 | ENV DEBIAN_FRONTEND noninteractive
7 |
8 | RUN apt-get update -q
9 | RUN apt-get install -qy texlive-full
10 | RUN apt-get install -qy \
11 | gnuplot \
12 | wget \
13 | build-essential
14 |
15 | ADD ./getFiraFont.sh ./getFiraFont.sh
16 | RUN ./getFiraFont.sh
17 |
18 | WORKDIR /data
19 | VOLUME ["/data"]
20 |
--------------------------------------------------------------------------------
/docker/getFiraFont.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ## cf from http://programster.blogspot.com/2014/05/ubuntu-14-desktop-install-fira-sans-and.html
4 |
5 | cd /tmp
6 |
7 | # install unzip just in case the user doesn't already have it.
8 | apt-get install unzip -y
9 |
10 | # Fonts also available at: https://github.com/bBoxType/FiraSans
11 | wget "https://bboxtype.com/downloads/Fira/Download_Folder_FiraSans_4301.zip"
12 | wget "https://bboxtype.com/downloads/Fira/Fira_Mono_3_2.zip"
13 |
14 | unzip Download_Folder_FiraSans_4301.zip
15 | unzip Fira_Mono_3_2.zip
16 |
17 | sudo mkdir -p /usr/share/fonts/truetype/FiraSans
18 | sudo mkdir -p /usr/share/fonts/opentype/FiraSans
19 |
20 | cp Download_Folder_FiraSans_4301/Fonts/Fira_Sans_TTF_4301/*/*/*.ttf \
21 | /usr/share/fonts/truetype/FiraSans/
22 | cp Download_Folder_FiraSans_4301/Fonts/Fira_Sans_OTF_4301/*/*/*.otf \
23 | /usr/share/fonts/opentype/FiraSans/
24 | cp Fira_Mono_3_2/Fonts/FiraMono_WEB_32/*.ttf /usr/share/fonts/truetype/FiraSans
25 | cp Fira_Mono_3_2/Fonts/FiraMono_OTF_32/*.otf /usr/share/fonts/truetype/FiraSans
26 |
27 | rm Download_Folder_FiraSans_4301.zip Fira_Mono_3_2.zip
28 | rm -rf Download_Folder_FiraSans_4301 Fira_Mono_3_2
29 |
30 | fc-cache -fv
31 |
--------------------------------------------------------------------------------
/source/beamercolorthememetropolis-highcontrast.dtx:
--------------------------------------------------------------------------------
1 | % \iffalse meta-comment -------------------------------------------------------
2 | % Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
3 | % contributors can be found at
4 | %
5 | % https://github.com/matze/mtheme/graphs/contributors
6 | %
7 | % and the original template was based on the HSRM theme by Benjamin Weiss.
8 | %
9 | % This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
10 | % International License (https://creativecommons.org/licenses/by-sa/4.0/).
11 | % ------------------------------------------------------------------------- \fi
12 | % \iffalse
13 | %<*package>
14 | \NeedsTeXFormat{LaTeX2e}
15 | \ProvidesPackage{beamercolorthememetropolis-highcontrast}[2017/01/23 Metropolis color theme]
16 | %
17 | % \fi
18 | % \CheckSum{0}
19 | % \StopEventually{}
20 | % \iffalse
21 | %<*package>
22 | % ------------------------------------------------------------------------- \fi
23 | %
24 | \usecolortheme{metropolis}
25 |
26 | \definecolor{mAlert}{HTML}{AD003D}
27 | \definecolor{mExample}{HTML}{005580}
28 |
29 | \setbeamercolor{normal text}{%
30 | fg=black,
31 | bg=white
32 | }
33 | \setbeamercolor{alerted text}{%
34 | fg=mAlert,
35 | }
36 | \setbeamercolor{example text}{%
37 | fg=mExample,
38 | }
39 | %
40 | % \begin{macrocode}
41 | \mode
42 | % \end{macrocode}
43 | %
44 | % \iffalse
45 | %
46 | % \fi
47 | % \Finale
48 | \endinput
49 |
--------------------------------------------------------------------------------
/source/beamercolorthememetropolis.dtx:
--------------------------------------------------------------------------------
1 | % \iffalse meta-comment -------------------------------------------------------
2 | % Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
3 | % contributors can be found at
4 | %
5 | % https://github.com/matze/mtheme/graphs/contributors
6 | %
7 | % and the original template was based on the HSRM theme by Benjamin Weiss.
8 | %
9 | % This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
10 | % International License (https://creativecommons.org/licenses/by-sa/4.0/).
11 | % ------------------------------------------------------------------------- \fi
12 | % \iffalse
13 | %<*package>
14 | \NeedsTeXFormat{LaTeX2e}
15 | \ProvidesPackage{beamercolorthememetropolis}[2017/01/23 Metropolis color theme]
16 | %
17 | % \fi
18 | % \CheckSum{0}
19 | % \StopEventually{}
20 | % \iffalse
21 | %<*package>
22 | % ------------------------------------------------------------------------- \fi
23 | %
24 | % \subsection{\themename color theme}
25 | %
26 | %
27 | %
28 | % \subsubsection{Package dependencies}
29 | % \begin{macrocode}
30 | \RequirePackage{pgfopts}
31 | % \end{macrocode}
32 | %
33 | %
34 | %
35 | % \subsubsection{Options}
36 | %
37 | % \begin{macro}{block}
38 | % Optionally adds a light grey background to block environments like
39 | % |theorem| and |example|.
40 | % \begin{macrocode}
41 | \pgfkeys{
42 | /metropolis/color/block/.cd,
43 | .is choice,
44 | transparent/.code=\metropolis@block@transparent,
45 | fill/.code=\metropolis@block@fill,
46 | }
47 | % \end{macrocode}
48 | % \end{macro}
49 | %
50 | % \begin{macro}{colors}
51 | % Provides the option to have a dark background and light foreground instead
52 | % of the reverse.
53 | % \begin{macrocode}
54 | \pgfkeys{
55 | /metropolis/color/background/.cd,
56 | .is choice,
57 | dark/.code=\metropolis@colors@dark,
58 | light/.code=\metropolis@colors@light,
59 | }
60 | % \end{macrocode}
61 | % \end{macro}
62 | %
63 | % \begin{macro}{\metropolis@color@setdefaults}
64 | % Sets default values for color theme options.
65 | % \begin{macrocode}
66 | \newcommand{\metropolis@color@setdefaults}{
67 | \pgfkeys{/metropolis/color/.cd,
68 | background=light,
69 | block=transparent,
70 | }
71 | }
72 | % \end{macrocode}
73 | % \end{macro}
74 | %
75 | %
76 | %
77 | % \subsubsection{Base colors}
78 | %
79 | % \begin{macrocode}
80 | \definecolor{mDarkBrown}{HTML}{604c38}
81 | \definecolor{mDarkTeal}{HTML}{23373b}
82 | \definecolor{mLightBrown}{HTML}{EB811B}
83 | \definecolor{mLightGreen}{HTML}{14B03D}
84 | % \end{macrocode}
85 | %
86 | %
87 | %
88 | % \subsubsection{Base styles}
89 | %
90 | % All colors in \themename are derived from the definitions of |normal text|,
91 | % |alerted text|, and |example text|.
92 | %
93 | % \begin{macrocode}
94 | \newcommand{\metropolis@colors@dark}{
95 | \setbeamercolor{normal text}{%
96 | fg=black!2,
97 | bg=mDarkTeal
98 | }
99 | \usebeamercolor[fg]{normal text}
100 | }
101 | \newcommand{\metropolis@colors@light}{
102 | \setbeamercolor{normal text}{%
103 | fg=mDarkTeal,
104 | bg=black!2
105 | }
106 | }
107 | \setbeamercolor{alerted text}{%
108 | fg=mLightBrown
109 | }
110 | \setbeamercolor{example text}{%
111 | fg=mLightGreen
112 | }
113 | % \end{macrocode}
114 | %
115 | %
116 | %
117 | % \subsubsection{Derived colors}
118 | %
119 | % The titles and structural elements (e.g. |itemize| bullets) are set in the
120 | % same color as |normal text|. This would ideally done by setting |normal text|
121 | % as a parent style, which we do to set |titlelike|, but this doesn't work for
122 | % |structure| as its foreground is set explicitly in
123 | % |beamercolorthemedefault.sty|.
124 | %
125 | % \begin{macrocode}
126 | \setbeamercolor{titlelike}{use=normal text, parent=normal text}
127 | \setbeamercolor{author}{use=normal text, parent=normal text}
128 | \setbeamercolor{date}{use=normal text, parent=normal text}
129 | \setbeamercolor{institute}{use=normal text, parent=normal text}
130 | \setbeamercolor{structure}{use=normal text, fg=normal text.fg}
131 | % \end{macrocode}
132 | %
133 | % The “primary” palette should be used for the most important navigational
134 | % elements, and possibly of other elements. \themename uses it for frame
135 | % titles and slides.
136 | %
137 | % \begin{macrocode}
138 | \setbeamercolor{palette primary}{%
139 | use=normal text,
140 | fg=normal text.bg,
141 | bg=normal text.fg
142 | }
143 | \setbeamercolor{frametitle}{%
144 | use=palette primary,
145 | parent=palette primary
146 | }
147 | % \end{macrocode}
148 | %
149 | % The \themename inner or outer themes optionally display progress
150 | % bars in various locations. Their color is set by |progress bar| but the two
151 | % different kinds can be customized separately. The horizontal rule on the
152 | % title page is also set based on the progress bar color and can be customized
153 | % with |title separator|.
154 | %
155 | % \begin{macrocode}
156 | \setbeamercolor{progress bar}{%
157 | use=alerted text,
158 | fg=alerted text.fg,
159 | bg=alerted text.fg!50!black!30
160 | }
161 | \setbeamercolor{title separator}{
162 | use=progress bar,
163 | parent=progress bar
164 | }
165 | \setbeamercolor{progress bar in head/foot}{%
166 | use=progress bar,
167 | parent=progress bar
168 | }
169 | \setbeamercolor{progress bar in section page}{
170 | use=progress bar,
171 | parent=progress bar
172 | }
173 | % \end{macrocode}
174 | %
175 | % Block environments such as |theorem| and |example| have no background color
176 | % by default. The option |block=fill| sets a background color based on the
177 | % background and foreground of |normal text|. The option |block=transparent|
178 | % reverts the block environments to an empty background, which can be useful
179 | % if changing colors mid-presentation.
180 | %
181 | % \begin{macrocode}
182 | \newcommand{\metropolis@block@transparent}{
183 | \setbeamercolor{block title}{%
184 | use=normal text,
185 | fg=normal text.fg,
186 | bg=
187 | }
188 | \setbeamercolor{block body}{
189 | bg=
190 | }
191 | }
192 | \newcommand{\metropolis@block@fill}{
193 | \setbeamercolor{block title}{%
194 | use=normal text,
195 | fg=normal text.fg,
196 | bg=normal text.bg!80!fg
197 | }
198 | \setbeamercolor{block body}{
199 | use={block title, normal text},
200 | bg=block title.bg!50!normal text.bg
201 | }
202 | }
203 | \setbeamercolor{block title alerted}{%
204 | use={block title, alerted text},
205 | bg=block title.bg,
206 | fg=alerted text.fg
207 | }
208 | \setbeamercolor{block title example}{%
209 | use={block title, example text},
210 | bg=block title.bg,
211 | fg=example text.fg
212 | }
213 | \setbeamercolor{block body alerted}{use=block body, parent=block body}
214 | \setbeamercolor{block body example}{use=block body, parent=block body}
215 | % \end{macrocode}
216 | %
217 | % Footnotes
218 | %
219 | % \begin{macrocode}
220 | \setbeamercolor{footnote}{fg=normal text.fg!90}
221 | \setbeamercolor{footnote mark}{fg=.}
222 | % \end{macrocode}
223 | %
224 | % We also reset the bibliography colors in order to pick up the surrounding
225 | % colors at the time of use. This prevents us having to set the correct color in
226 | % normal and standout mode.
227 | %
228 | % \begin{macrocode}
229 | \setbeamercolor{bibliography entry author}{fg=, bg=}
230 | \setbeamercolor{bibliography entry title}{fg=, bg=}
231 | \setbeamercolor{bibliography entry location}{fg=, bg=}
232 | \setbeamercolor{bibliography entry note}{fg=, bg=}
233 | % \end{macrocode}
234 | %
235 | %
236 | %
237 | % \subsubsection{Process package options}
238 | %
239 | % \begin{macrocode}
240 | \metropolis@color@setdefaults
241 | \ProcessPgfPackageOptions{/metropolis/color}
242 | % \end{macrocode}
243 | %
244 | % \begin{macrocode}
245 | \mode
246 | % \end{macrocode}
247 | %
248 | % \iffalse
249 | %
250 | % \fi
251 | % \Finale
252 | \endinput
253 |
--------------------------------------------------------------------------------
/source/beamerfontthememetropolis.dtx:
--------------------------------------------------------------------------------
1 | % \iffalse meta-comment -------------------------------------------------------
2 | % Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
3 | % contributors can be found at
4 | %
5 | % https://github.com/matze/mtheme/graphs/contributors
6 | %
7 | % and the original template was based on the HSRM theme by Benjamin Weiss.
8 | %
9 | % This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
10 | % International License (https://creativecommons.org/licenses/by-sa/4.0/).
11 | % ------------------------------------------------------------------------- \fi
12 | % \iffalse
13 | %<*package>
14 | \NeedsTeXFormat{LaTeX2e}
15 | \ProvidesPackage{beamerfontthememetropolis}[2017/01/23 Metropolis font theme]
16 | %
17 | % \fi
18 | % \CheckSum{0}
19 | % \StopEventually{}
20 | % \iffalse
21 | %<*package>
22 | % ------------------------------------------------------------------------- \fi
23 | %
24 | % \subsection{\themename font theme}
25 | %
26 | % A |beamer| font theme sets the style of the font used in the document.
27 | %
28 | %
29 | %
30 | % \subsubsection{Package dependencies}
31 | %
32 | % \begin{macrocode}
33 | \RequirePackage{etoolbox}
34 | \RequirePackage{ifxetex}
35 | \RequirePackage{ifluatex}
36 | \RequirePackage{pgfopts}
37 | % \end{macrocode}
38 | %
39 | %
40 | %
41 | % \subsubsection{Load Fira fonts}
42 | %
43 | % If the presentation is compiled with Xe\LaTeX{} or Lua\LaTeX{}, the fontspec
44 | % package is loaded and we search for the |Fira| fonts.
45 | %
46 | % \begin{macrocode}
47 | \ifboolexpr{bool {xetex} or bool {luatex}}{
48 | \@ifpackageloaded{fontspec}{
49 | \PassOptionsToPackage{no-math}{fontspec}
50 | }{
51 | \RequirePackage[no-math]{fontspec}
52 | }
53 | % \end{macrocode}
54 | %
55 | % \begin{macro}{\checkfont}
56 | % Checks if a font is installed; if not, |fontsnotfound| is increased.
57 | % \begin{macrocode}
58 | \newcounter{fontsnotfound}
59 | \newcommand{\checkfont}[1]{%
60 | \suppressfontnotfounderror=1%
61 | \font\x = "#1" at 10pt
62 | \selectfont
63 | \ifx\x\nullfont%
64 | \stepcounter{fontsnotfound}%
65 | \fi%
66 | \suppressfontnotfounderror=0%
67 | }
68 |
69 | % \end{macrocode}
70 | % \end{macro}
71 | %
72 | % \begin{macro}{\iffontsavailable}
73 | % Resets the |fontsnotfound| counter and calls |\checkfont| for each font in
74 | % the comma separated list in the first argument.
75 | % \begin{macrocode}
76 | \newcommand{\iffontsavailable}[3]{%
77 | \setcounter{fontsnotfound}{0}%
78 | \expandafter\forcsvlist\expandafter%
79 | \checkfont\expandafter{#1}%
80 | \ifnum\value{fontsnotfound}=0%
81 | #2%
82 | \else%
83 | #3%
84 | \fi%
85 | }
86 | % \end{macrocode}
87 | % \end{macro}
88 | %
89 | % We search for regular, italic, light, light italic, mono, and mono bold
90 | % fonts under the default |Fira Sans| and |Fira Mono| names. If this fails,
91 | % the suffix OT --- used by some Linux distributions --- will be tried. If this
92 | % also fails, a warning will be displayed and the standard fonts will be used.
93 | %
94 | % \begin{macrocode}
95 | \iffontsavailable{Fira Sans Light,%
96 | Fira Sans Light Italic,%
97 | Fira Sans,%
98 | Fira Sans Italic}%
99 | {%
100 | \setsansfont[ItalicFont={Fira Sans Light Italic},%
101 | BoldFont={Fira Sans},%
102 | BoldItalicFont={Fira Sans Italic}]%
103 | {Fira Sans Light}%
104 | }{%
105 | \iffontsavailable{Fira Sans Light OT,%
106 | Fira Sans Light Italic OT,%
107 | Fira Sans OT,%
108 | Fira Sans Italic OT}%
109 | {%
110 | \setsansfont[ItalicFont={Fira Sans Light Italic OT},%
111 | BoldFont={Fira Sans OT},%
112 | BoldItalicFont={Fira Sans Italic OT}]%
113 | {Fira Sans Light OT}%
114 | }{%
115 | \PackageWarning{beamerthememetropolis}{%
116 | Could not find Fira Sans fonts%
117 | }
118 | }
119 | }
120 | \iffontsavailable{Fira Mono, Fira Mono Bold}{%
121 | \setmonofont[BoldFont={Fira Mono Medium}]{Fira Mono}%
122 | }{%
123 | \iffontsavailable{Fira Mono OT, Fira Mono Bold OT}{%
124 | \setmonofont[BoldFont={Fira Mono Medium OT}]{Fira Mono OT}%
125 | }{%
126 | \PackageWarning{beamerthememetropolis}{%
127 | Could not find Fira Mono fonts%
128 | }
129 | }
130 | }
131 | \AtBeginEnvironment{tabular}{%
132 | \addfontfeature{Numbers={Monospaced}}%
133 | }
134 | }{%
135 | \PackageWarning{beamerthememetropolis}{%
136 | You need to compile with XeLaTeX or LuaLaTeX to use the Fira fonts%
137 | }
138 | }
139 | % \end{macrocode}
140 | %
141 | % This concludes the portion of the code which is only run when compiled with
142 | % Xe\LaTeX{} or Lua\LaTeX{}. The remainder of this package applies regardless
143 | % of the compiling engine.
144 | %
145 | %
146 | %
147 | % \subsubsection{General font definitions}
148 | %
149 | % \begin{macrocode}
150 | \setbeamerfont{title}{size=\Large,%
151 | series=\bfseries}
152 | \setbeamerfont{author}{size=\small}
153 | \setbeamerfont{date}{size=\small}
154 | \setbeamerfont{section title}{size=\Large,%
155 | series=\bfseries}
156 | \setbeamerfont{block title}{size=\normalsize,%
157 | series=\bfseries}
158 | \setbeamerfont{block title alerted}{size=\normalsize,%
159 | series=\bfseries}
160 | \setbeamerfont*{subtitle}{size=\large}
161 | \setbeamerfont{frametitle}{size=\large,%
162 | series=\bfseries}
163 | \setbeamerfont{caption}{size=\small}
164 | \setbeamerfont{caption name}{series=\bfseries}
165 | \setbeamerfont{description item}{series=\bfseries}
166 | \setbeamerfont{page number in head/foot}{size=\scriptsize}
167 | \setbeamerfont{bibliography entry author}{size=\normalsize,%
168 | series=\normalfont}
169 | \setbeamerfont{bibliography entry title}{size=\normalsize,%
170 | series=\bfseries}
171 | \setbeamerfont{bibliography entry location}{size=\normalsize,%
172 | series=\normalfont}
173 | \setbeamerfont{bibliography entry note}{size=\small,%
174 | series=\normalfont}
175 | \setbeamerfont{standout}{size=\Large,%
176 | series=\bfseries}
177 | % \end{macrocode}
178 | %
179 | %
180 | %
181 | % \subsubsection{Title format options}
182 | %
183 | % \begin{macro}{titleformat title}
184 | % Controls the format of the title.
185 | % \begin{macrocode}
186 | \pgfkeys{
187 | /metropolis/font/titleformat title/.cd,
188 | .is choice,
189 | regular/.code={%
190 | \let\metropolis@titleformat\@empty%
191 | \setbeamerfont{title}{shape=\normalfont}%
192 | },
193 | smallcaps/.code={%
194 | \let\metropolis@titleformat\@empty%
195 | \setbeamerfont{title}{shape=\scshape}%
196 | },
197 | allsmallcaps/.code={%
198 | \let\metropolis@titleformat\lowercase%
199 | \setbeamerfont{title}{shape=\scshape}%
200 | \PackageWarning{beamerthememetropolis}{%
201 | Be aware that titleformat title=allsmallcaps can lead to problems%
202 | }
203 | },
204 | allcaps/.code={%
205 | \let\metropolis@titleformat\uppercase%
206 | \setbeamerfont{title}{shape=\normalfont}
207 | \PackageWarning{beamerthememetropolis}{%
208 | Be aware that titleformat title=allcaps can lead to problems%
209 | }
210 | },
211 | }
212 | % \end{macrocode}
213 | % \end{macro}
214 | %
215 | % \begin{macro}{titleformat subtitle}
216 | % Control the format of the subtitle.
217 | % \begin{macrocode}
218 | \pgfkeys{
219 | /metropolis/font/titleformat subtitle/.cd,
220 | .is choice,
221 | regular/.code={%
222 | \let\metropolis@subtitleformat\@empty%
223 | \setbeamerfont{subtitle}{shape=\normalfont}%
224 | },
225 | smallcaps/.code={%
226 | \let\metropolis@subtitleformat\@empty%
227 | \setbeamerfont{subtitle}{shape=\scshape}%
228 | },
229 | allsmallcaps/.code={%
230 | \let\metropolis@subtitleformat\lowercase%
231 | \setbeamerfont{subtitle}{shape=\scshape}%
232 | \PackageWarning{beamerthememetropolis}{%
233 | Be aware that titleformat subtitle=allsmallcaps can lead to problems%
234 | }
235 | },
236 | allcaps/.code={%
237 | \let\metropolis@subtitleformat\uppercase%
238 | \setbeamerfont{subtitle}{shape=\normalfont}%
239 | \PackageWarning{beamerthememetropolis}{%
240 | Be aware that titleformat subtitle=allcaps can lead to problems%
241 | }
242 | },
243 | }
244 | % \end{macrocode}
245 | % \end{macro}
246 | %
247 | % \begin{macro}{titleformat section}
248 | % Controls the format of the section title.
249 | % \begin{macrocode}
250 | \pgfkeys{
251 | /metropolis/font/titleformat section/.cd,
252 | .is choice,
253 | regular/.code={%
254 | \let\metropolis@sectiontitleformat\@empty%
255 | \setbeamerfont{section title}{shape=\normalfont}%
256 | },
257 | smallcaps/.code={%
258 | \let\metropolis@sectiontitleformat\@empty%
259 | \setbeamerfont{section title}{shape=\scshape}%
260 | },
261 | allsmallcaps/.code={%
262 | \let\metropolis@sectiontitleformat\MakeLowercase%
263 | \setbeamerfont{section title}{shape=\scshape}%
264 | \PackageWarning{beamerthememetropolis}{%
265 | Be aware that titleformat section=allsmallcaps can lead to problems%
266 | }
267 | },
268 | allcaps/.code={%
269 | \let\metropolis@sectiontitleformat\MakeUppercase%
270 | \setbeamerfont{section title}{shape=\normalfont}%
271 | \PackageWarning{beamerthememetropolis}{%
272 | Be aware that titleformat section=allcaps can lead to problems%
273 | }
274 | },
275 | }
276 | % \end{macrocode}
277 | % \end{macro}
278 | %
279 | % \begin{macro}{frametitleformat}
280 | % Control the format of the frame title.
281 | % \begin{macrocode}
282 | \pgfkeys{
283 | /metropolis/font/titleformat frame/.cd,
284 | .is choice,
285 | regular/.code={%
286 | \let\metropolis@frametitleformat\@empty%
287 | \setbeamerfont{frametitle}{shape=\normalfont}%
288 | },
289 | smallcaps/.code={%
290 | \let\metropolis@frametitleformat\@empty%
291 | \setbeamerfont{frametitle}{shape=\scshape}%
292 | },
293 | allsmallcaps/.code={%
294 | \let\metropolis@frametitleformat\MakeLowercase%
295 | \setbeamerfont{frametitle}{shape=\scshape}%
296 | \PackageWarning{beamerthememetropolis}{%
297 | Be aware that titleformat frame=allsmallcaps can lead to problems%
298 | }
299 | },
300 | allcaps/.code={%
301 | \let\metropolis@frametitleformat\MakeUppercase%
302 | \setbeamerfont{frametitle}{shape=\normalfont}
303 | \PackageWarning{beamerthememetropolis}{%
304 | Be aware that titleformat frame=allcaps can lead to problems%
305 | }
306 | },
307 | }
308 | % \end{macrocode}
309 | % \end{macro}
310 | %
311 | % \begin{macro}{titleformat aliases}
312 | % Allows |titleformat title| et al. to be used in the |\usetheme|
313 | % declaration, where \LaTeX{} automatically removes all spaces.
314 | % \begin{macrocode}
315 | \pgfkeys{
316 | /metropolis/font/.cd,
317 | titleformattitle/.code=\pgfkeysalso{titleformat title=#1},
318 | titleformatsubtitle/.code=\pgfkeysalso{titleformat subtitle=#1},
319 | titleformatsection/.code=\pgfkeysalso{titleformat section=#1},
320 | titleformatframe/.code=\pgfkeysalso{titleformat frame=#1},
321 | }
322 | % \end{macrocode}
323 | % \end{macro}
324 | %
325 | % \begin{macro}{\metropolis@font@setdefaults}
326 | % Sets default values for font theme options.
327 | % \begin{macrocode}
328 | \newcommand{\metropolis@font@setdefaults}{
329 | \pgfkeys{/metropolis/font/.cd,
330 | titleformat title=regular,
331 | titleformat subtitle=regular,
332 | titleformat section=regular,
333 | titleformat frame=regular,
334 | }
335 | }
336 | % \end{macrocode}
337 | % \end{macro}
338 | %
339 | % We first define hooks to change the case format of the titles.
340 | %
341 | % \begin{macrocode}
342 | \def\metropolis@titleformat#1{#1}
343 | \def\metropolis@subtitleformat#1{#1}
344 | \def\metropolis@sectiontitleformat#1{#1}
345 | \def\metropolis@frametitleformat#1{#1}
346 | % \end{macrocode}
347 | %
348 | % To make the uppercase and lowercase macros work in the title, subtitle, etc.,
349 | % we have to patch the appropriate |beamer| commands that set their values.
350 | % This solution was suggested by Enrico Gregorio in an answer to
351 | % \href{http://tex.stackexchange.com/questions/112526/}{this StackExchange
352 | % question}.
353 | %
354 | % \begin{macrocode}
355 | \patchcmd{\beamer@title}%
356 | {\def\inserttitle{#2}}%
357 | {\def\inserttitle{\metropolis@titleformat{#2}}}%
358 | {}%
359 | {\PackageError{beamerfontthememetropolis}{Patching title failed}\@ehc}
360 | \patchcmd{\beamer@subtitle}%
361 | {\def\insertsubtitle{#2}}%
362 | {\def\insertsubtitle{\metropolis@subtitleformat{#2}}}%
363 | {}%
364 | {\PackageError{beamerfontthememetropolis}{Patching subtitle failed}\@ehc}
365 | \patchcmd{\sectionentry}
366 | {\def\insertsectionhead{#2}}
367 | {\def\insertsectionhead{\metropolis@sectiontitleformat{#2}}}
368 | {}
369 | {\PackageError{beamerfontthememetropolis}{Patching section title failed}\@ehc}
370 | \@tempswafalse
371 | \patchcmd{\beamer@section}
372 | {\edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{\unexpanded{#1}}}}
373 | {\edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{%
374 | \noexpand\metropolis@sectiontitleformat{\unexpanded{#1}}}}}
375 | {\@tempswatrue}
376 | {}
377 | \patchcmd{\beamer@section}
378 | {\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
379 | {\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{%
380 | \metropolis@sectiontitleformat{#1}}}}
381 | {\@tempswatrue}
382 | {}
383 | \patchcmd{\beamer@section}
384 | {\protected@edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{#1}}}
385 | {\protected@edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{%
386 | \noexpand\metropolis@sectiontitleformat{#1}}}}
387 | {\@tempswatrue}
388 | {}
389 | \if@tempswa\else
390 | \PackageError{beamerfontthememetropolis}{Patching section title failed}\@ehc
391 | \fi
392 | \@tempswafalse
393 | \patchcmd{\beamer@subsection}
394 | {\edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{\unexpanded{#1}}}}
395 | {\edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{%
396 | \noexpand\metropolis@sectiontitleformat{\unexpanded{#1}}}}}
397 | {\@tempswatrue}
398 | {}
399 | \patchcmd{\beamer@subsection}
400 | {\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
401 | {\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{%
402 | \metropolis@sectiontitleformat{#1}}}}
403 | {\@tempswatrue}
404 | {}
405 | \patchcmd{\beamer@subsection}
406 | {\protected@edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{#1}}}
407 | {\protected@edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{%
408 | \noexpand\metropolis@sectiontitleformat{#1}}}}
409 | {\@tempswatrue}
410 | {}
411 | \if@tempswa\else
412 | \PackageError{beamerfontthememetropolis}{Patching section title failed}\@ehc
413 | \fi
414 | % \end{macrocode}
415 | %
416 | % Similarly, to make the |\MakeLowercase| and |\MakeUppercase| macros work in
417 | % the frame title we have to patch |\beamer@@frametitle|.
418 | %
419 | % \begin{macrocode}
420 | \patchcmd{\beamer@@frametitle}
421 | {{%
422 | \gdef\insertframetitle{{#2\ifnum\beamer@autobreakcount>0\relax{}\space%
423 | \usebeamertemplate*{frametitle continuation}\fi}}%
424 | \gdef\beamer@frametitle{#2}%
425 | \gdef\beamer@shortframetitle{#1}%
426 | }}
427 | {{%
428 | \gdef\insertframetitle{{\metropolis@frametitleformat{#2}\ifnum%
429 | \beamer@autobreakcount>0\relax{}\space%
430 | \usebeamertemplate*{frametitle continuation}\fi}}%
431 | \gdef\beamer@frametitle{#2}%
432 | \gdef\beamer@shortframetitle{#1}%
433 | }}
434 | {}
435 | {\PackageError{beamerfontthememetropolis}{Patching frame title failed}\@ehc}
436 | % \end{macrocode}
437 | %
438 | %
439 | %
440 | % \subsubsection{Process package options}
441 | %
442 | % \begin{macrocode}
443 | \metropolis@font@setdefaults
444 | \ProcessPgfPackageOptions{/metropolis/font}
445 | % \end{macrocode}
446 | % \iffalse
447 | %
448 | % \fi
449 | % \Finale
450 | \endinput
451 |
--------------------------------------------------------------------------------
/source/beamerinnerthememetropolis.dtx:
--------------------------------------------------------------------------------
1 | % \iffalse meta-comment -------------------------------------------------------
2 | % Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
3 | % contributors can be found at
4 | %
5 | % https://github.com/matze/mtheme/graphs/contributors
6 | %
7 | % and the original template was based on the HSRM theme by Benjamin Weiss.
8 | %
9 | % This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
10 | % International License (https://creativecommons.org/licenses/by-sa/4.0/).
11 | % ------------------------------------------------------------------------- \fi
12 | % \iffalse
13 | %<*package>
14 | \NeedsTeXFormat{LaTeX2e}
15 | \ProvidesPackage{beamerinnerthememetropolis}[2017/01/23 Metropolis inner theme]
16 | %
17 | % \fi
18 | % \CheckSum{0}
19 | % \StopEventually{}
20 | % \iffalse
21 | %<*package>
22 | % ------------------------------------------------------------------------- \fi
23 | %
24 | % \subsection{\themename inner theme}
25 | %
26 | % A |beamer| inner theme dictates the style of the frame elements traditionally
27 | % set in the ``body'' of each slide. These include:
28 | %
29 | % \begin{itemize}
30 | % \item title, part, and section pages;
31 | % \item itemize, enumerate, and description environments;
32 | % \item block environments including theorems and proofs;
33 | % \item figures and tables; and
34 | % \item footnotes and plain text.
35 | % \end{itemize}
36 | %
37 | %
38 | %
39 | % \subsubsection{Package dependencies}
40 | %
41 | % \begin{macrocode}
42 | \RequirePackage{etoolbox}
43 | \RequirePackage{keyval}
44 | \RequirePackage{calc}
45 | \RequirePackage{pgfopts}
46 | \RequirePackage{tikz}
47 | % \end{macrocode}
48 | %
49 | %
50 | %
51 | % \subsubsection{Options}
52 | %
53 | % \begin{macro}{sectionpage}
54 | % Optionally add a slide marking the beginning of each section.
55 | % \begin{macrocode}
56 | \pgfkeys{
57 | /metropolis/inner/sectionpage/.cd,
58 | .is choice,
59 | none/.code=\metropolis@disablesectionpage,
60 | simple/.code={\metropolis@enablesectionpage
61 | \setbeamertemplate{section page}[simple]},
62 | progressbar/.code={\metropolis@enablesectionpage
63 | \setbeamertemplate{section page}[progressbar]},
64 | }
65 | % \end{macrocode}
66 | % \end{macro}
67 | %
68 | % \begin{macro}{subsectionpage}
69 | % Optionally add a slide marking the beginning of each subsection.
70 | % \begin{macrocode}
71 | \pgfkeys{
72 | /metropolis/inner/subsectionpage/.cd,
73 | .is choice,
74 | none/.code=\metropolis@disablesubsectionpage,
75 | simple/.code={\metropolis@enablesubsectionpage
76 | \setbeamertemplate{section page}[simple]},
77 | progressbar/.code={\metropolis@enablesubsectionpage
78 | \setbeamertemplate{section page}[progressbar]},
79 | }
80 | % \end{macrocode}
81 | % \end{macro}
82 | %
83 | % \begin{macro}{\metropolis@inner@setdefaults}
84 | % Set default values for inner theme options.
85 | % \begin{macrocode}
86 | \newcommand{\metropolis@inner@setdefaults}{
87 | \pgfkeys{/metropolis/inner/.cd,
88 | sectionpage=progressbar,
89 | subsectionpage=none
90 | }
91 | }
92 | % \end{macrocode}
93 | % \end{macro}
94 | %
95 | %
96 | %
97 | % \subsubsection{Title page}
98 | %
99 | % \begin{macro}{title page}
100 | % Template for the title page. Each element is only typset if it is defined
101 | % by the user. If |\subtitle| is empty, for example, it won't leave a blank
102 | % space on the title slide.
103 | % \begin{macrocode}
104 | \setbeamertemplate{title page}{
105 | \begin{minipage}[b][\paperheight]{\textwidth}
106 | \ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi
107 | \vfill%
108 | \ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi
109 | \ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi
110 | \usebeamertemplate*{title separator}
111 | % \end{macrocode}
112 | %
113 | % Beamer's definition of |\insertauthor| is always nonempty, so we have
114 | % to test another macro initialized by |\author{...}| to see if the user has
115 | % defined an author. This solution was suggested by Enrico Gregorio in an
116 | % answer to \href{https://tex.stackexchange.com/questions/241306/}{this
117 | % Stack Exchange question}.
118 | %
119 | % \begin{macrocode}
120 | \ifx\beamer@shortauthor\@empty\else\usebeamertemplate*{author}\fi
121 | \ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi
122 | \ifx\insertinstitute\@empty\else\usebeamertemplate*{institute}\fi
123 | \vfill
124 | \vspace*{1mm}
125 | \end{minipage}
126 | }
127 | % \end{macrocode}
128 | % \end{macro}%
129 | %
130 | % Normal people should use |\maketitle| or |\titlepage| instead of using the
131 | % |title page| beamer template directly. Beamer already defines these macros,
132 | % but we patch them here to make the title page |[plain]| by default, remove
133 | % |\@thanks|, and ensure the title frame number doesn't count.
134 | %
135 | % \begin{macro}{\maketitle}
136 | % \begin{macro}{\titlepage}
137 | %
138 | % Inserts the title frame, or causes the current frame to use the
139 | % |title page| template.
140 | %
141 | % \begin{macrocode}
142 | \def\maketitle{%
143 | \ifbeamer@inframe
144 | \titlepage
145 | \else
146 | \frame[plain,noframenumbering]{\titlepage}
147 | \fi
148 | }
149 | \def\titlepage{%
150 | \usebeamertemplate{title page}
151 | }
152 | % \end{macrocode}
153 | % \end{macro}
154 | % \end{macro}
155 | %
156 | % \begin{macro}{title graphic}
157 | % Set the title graphic in a zero-height box, so it doesn't change the
158 | % position of other elements.
159 | % \begin{macrocode}
160 | \setbeamertemplate{title graphic}{
161 | \vbox to 0pt {
162 | \vspace*{2em}
163 | \inserttitlegraphic%
164 | }%
165 | \nointerlineskip%
166 | }
167 | % \end{macrocode}
168 | % \end{macro}
169 | %
170 | % \begin{macro}{title}
171 | % Set the title on the title page.
172 | % \begin{macrocode}
173 | \setbeamertemplate{title}{
174 | \raggedright%
175 | \linespread{1.0}%
176 | \inserttitle%
177 | \par%
178 | \vspace*{0.5em}
179 | }
180 | % \end{macrocode}
181 | % \end{macro}
182 | %
183 | % \begin{macro}{subtitle}
184 | % Set the subtitle on the title page.
185 | % \begin{macrocode}
186 | \setbeamertemplate{subtitle}{
187 | \raggedright%
188 | \insertsubtitle%
189 | \par%
190 | \vspace*{0.5em}
191 | }
192 | % \end{macrocode}
193 | % \end{macro}
194 | %
195 | % \begin{macro}{title separator}
196 | % Template to set the title graphic in a zero-height box. (It won't
197 | % change the position of other elements.)
198 | % \begin{macrocode}
199 | \newlength{\metropolis@titleseparator@linewidth}
200 | \setlength{\metropolis@titleseparator@linewidth}{0.4pt}
201 | \setbeamertemplate{title separator}{
202 | \tikzexternaldisable%
203 | \begin{tikzpicture}
204 | \fill[fg] (0,0) rectangle (\textwidth, \metropolis@titleseparator@linewidth);
205 | \end{tikzpicture}%
206 | \tikzexternalenable%
207 | \par%
208 | }
209 | % \end{macrocode}
210 | % \end{macro}
211 | %
212 | % \begin{macro}{author}
213 | % Set the author on the title page.
214 | % \begin{macrocode}
215 | \setbeamertemplate{author}{
216 | \vspace*{2em}
217 | \insertauthor%
218 | \par%
219 | \vspace*{0.25em}
220 | }
221 | % \end{macrocode}
222 | % \end{macro}
223 | %
224 | % \begin{macro}{date}
225 | % Set the date on the title page.
226 | % \begin{macrocode}
227 | \setbeamertemplate{date}{
228 | \insertdate%
229 | \par%
230 | }
231 | % \end{macrocode}
232 | % \end{macro}
233 | %
234 | % \begin{macro}{institute}
235 | % Set the institute on the title page.
236 | % \begin{macrocode}
237 | \setbeamertemplate{institute}{
238 | \vspace*{3mm}
239 | \insertinstitute%
240 | \par%
241 | }
242 | % \end{macrocode}
243 | % \end{macro}
244 | %
245 | %
246 | %
247 | % \subsubsection{Section page}
248 | %
249 | % \begin{macro}{section page}
250 | %
251 | % Template for the section title slide at the beginning of each section.
252 | %
253 | % \begin{macrocode}
254 | \defbeamertemplate{section page}{simple}{
255 | \begin{center}
256 | \usebeamercolor[fg]{section title}
257 | \usebeamerfont{section title}
258 | \insertsectionhead\par
259 | \ifx\insertsubsectionhead\@empty\else
260 | \usebeamercolor[fg]{subsection title}
261 | \usebeamerfont{subsection title}
262 | \insertsubsectionhead
263 | \fi
264 | \end{center}
265 | }
266 | \defbeamertemplate{section page}{progressbar}{
267 | \centering
268 | \begin{minipage}{22em}
269 | \raggedright
270 | \usebeamercolor[fg]{section title}
271 | \usebeamerfont{section title}
272 | \insertsectionhead\\[-1ex]
273 | \usebeamertemplate*{progress bar in section page}
274 | \par
275 | \ifx\insertsubsectionhead\@empty\else%
276 | \usebeamercolor[fg]{subsection title}%
277 | \usebeamerfont{subsection title}%
278 | \insertsubsectionhead
279 | \fi
280 | \end{minipage}
281 | \par
282 | \vspace{\baselineskip}
283 | }
284 | \newcommand{\metropolis@disablesectionpage}{
285 | \AtBeginSection{
286 | % intentionally empty
287 | }
288 | }
289 | \newcommand{\metropolis@enablesectionpage}{
290 | \AtBeginSection{
291 | \ifbeamer@inframe
292 | \sectionpage
293 | \else
294 | \frame[plain,c,noframenumbering]{\sectionpage}
295 | \fi
296 | }
297 | }
298 | % \end{macrocode}
299 | % \end{macro}
300 | %
301 | % \begin{macro}{subsection page}
302 | %
303 | % Template for the subsection title slide that can optionally be added to
304 | % at the beginning of each subsection.
305 | %
306 | % \begin{macrocode}
307 | \setbeamertemplate{subsection page}{%
308 | \usebeamertemplate*{section page}
309 | }
310 | \newcommand{\metropolis@disablesubsectionpage}{
311 | \AtBeginSubsection{
312 | % intentionally empty
313 | }
314 | }
315 | \newcommand{\metropolis@enablesubsectionpage}{
316 | \AtBeginSubsection{
317 | \ifbeamer@inframe
318 | \subsectionpage
319 | \else
320 | \frame[plain,c,noframenumbering]{\subsectionpage}
321 | \fi
322 | }
323 | }
324 | % \end{macrocode}
325 | % \end{macro}
326 | %
327 | % \begin{macro}{progress bar in section page}
328 | %
329 | % Template for the progress bar displayed by default on the section page.
330 | % This code is duplicated in large part in the outer theme's template
331 | % |progress bar in head/foot|.
332 | %
333 | % \begin{macrocode}
334 | \newlength{\metropolis@progressonsectionpage}
335 | \newlength{\metropolis@progressonsectionpage@linewidth}
336 | \setlength{\metropolis@progressonsectionpage@linewidth}{0.4pt}
337 | \setbeamertemplate{progress bar in section page}{
338 | \setlength{\metropolis@progressonsectionpage}{%
339 | \textwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
340 | }%
341 | \tikzexternaldisable%
342 | \begin{tikzpicture}
343 | \fill[bg] (0,0) rectangle (\textwidth, \metropolis@progressonsectionpage@linewidth);
344 | \fill[fg] (0,0) rectangle (\metropolis@progressonsectionpage, \metropolis@progressonsectionpage@linewidth);
345 | \end{tikzpicture}%
346 | \tikzexternalenable%
347 | }
348 | % \end{macrocode}
349 | %
350 | % The above code assumes that |\insertframenumber| is less than or equal to
351 | % |\inserttotalframenumber|. However, this is not true on the first compile;
352 | % in the absence of an |.aux| file, |\inserttotalframenumber| defaults to 1.
353 | % This behaviour could cause fatal errors for long presentations, as
354 | % |\metropolis@progressonsectionpage| would exceed \TeX's maximum length
355 | % (16383.99999pt, roughly 5.75 metres or 18.9 feet).
356 | % To avoid this, we increase the default value for |\inserttotalframenumber|;
357 | % presentations with over 4000 slides will still break on first compile, but
358 | % users in that situation likely have deeper problems to solve.
359 | %
360 | % \begin{macrocode}
361 | \def\inserttotalframenumber{100}
362 | % \end{macrocode}
363 | % \end{macro}
364 | %
365 | %
366 | %
367 | % \subsubsection{Block environments}
368 | %
369 | %
370 | % \begin{macro}{block}
371 | % \begin{macro}{block alerted}
372 | % \begin{macro}{block example}
373 | %
374 | % The three different block environments differ only in their colours.
375 | % Rather than repeat the essentially the same template three times, we use
376 | % the auxiliary macro |\metropolis@block| to define all three templates.
377 | %
378 | % \begin{macrocode}
379 | \newlength{\metropolis@blocksep}
380 | \newlength{\metropolis@blockadjust}
381 | \setlength{\metropolis@blocksep}{0.75ex}
382 | \setlength{\metropolis@blockadjust}{0.25ex}
383 | \providecommand{\metropolis@strut}{%
384 | \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()}%
385 | }
386 | \newcommand{\metropolis@block}[1]{
387 | \par\vskip\medskipamount%
388 | \setlength{\parskip}{0pt}
389 | % \end{macrocode}
390 | %
391 | % If a background color is defined for the block title or body, we need to
392 | % add a little bit of padding to the corresponding box. Ideally, this would
393 | % be accomplished by setting |colsep=0.75ex|, which is intended to add
394 | % ``color separation space'' only when the box has a colored background.
395 | % Unfortunately, |colsep| also adds this separation if the background color
396 | % is inherited, even if the inherited color is actually empty.
397 | % (The technical reason for this boils down to the fact that the |\ifx|
398 | % directive does not expand macros.)
399 | %
400 | % To achieve the correct spacing for |alertblock|s and |exampleblock|s
401 | % as well as for normal blocks, we have to begin the |beamercolorbox|
402 | % differently based on whether |block title| has an empty background.
403 | %
404 | % If the |block title| background is empty, or the user has explicitly
405 | % removed the background from (e.g.) |block title alerted|, we just need to
406 | % set a rightskip for a nice ragged-right block title.
407 | %
408 | % \begin{macrocode}
409 | \ifbeamercolorempty[bg]{block title#1}{%
410 | \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}}{%
411 | \ifbeamercolorempty[bg]{block title}{%
412 | \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}%
413 | }%
414 | % \end{macrocode}
415 | %
416 | % Otherwise, if the |block title| has a background, we set the padding based
417 | % on |\metropolis@blockskip|. However, we have to visually compensate for
418 | % the |\metropolis@strut| added to the block title (see below) by
419 | % subtracting |\metropolis@blockadjust| from the top and bottom padding.
420 | %
421 | % \begin{macrocode}
422 | {%
423 | \begin{beamercolorbox}[
424 | sep=\dimexpr\metropolis@blocksep-\metropolis@blockadjust\relax,
425 | leftskip=\metropolis@blockadjust,
426 | rightskip=\dimexpr\metropolis@blockadjust plus 4em\relax
427 | ]{block title#1}%
428 | }}%
429 | % \end{macrocode}
430 | %
431 | % We can now set the contents of the |block title|. The zero-width but
432 | % positive-height box |\metropolis@strut| ensures that the block title box
433 | % has a consistent height, even if it lacks punctuation, ascenders, or
434 | % descenders.
435 | %
436 | % \begin{macrocode}
437 | \usebeamerfont*{block title#1}%
438 | \metropolis@strut%
439 | \insertblocktitle%
440 | \metropolis@strut%
441 | \end{beamercolorbox}%
442 | % \end{macrocode}
443 | %
444 | % Next, we typeset the |block body|. This the code is similar to, but simpler
445 | % than, the |block title| code since we don't need to adjust for any struts.
446 | %
447 | % \begin{macrocode}
448 | \nointerlineskip%
449 | \ifbeamercolorempty[bg]{block body#1}{%
450 | \begin{beamercolorbox}[vmode]{block body#1}}{
451 | \ifbeamercolorempty[bg]{block body}{%
452 | \begin{beamercolorbox}[vmode]{block body#1}%
453 | }{%
454 | \begin{beamercolorbox}[sep=\metropolis@blocksep, vmode]{block body#1}%
455 | \vspace{-\metropolis@parskip}
456 | }}%
457 | \usebeamerfont{block body#1}%
458 | \setlength{\parskip}{\metropolis@parskip}%
459 | }
460 | % \end{macrocode}
461 | %
462 | % This concludes the auxiliary macro |\metropolis@block|. Finally,
463 | % we define the block beamer templates using this macro.
464 | %
465 | % \begin{macrocode}
466 | \setbeamertemplate{block begin}{\metropolis@block{}}
467 | \setbeamertemplate{block alerted begin}{\metropolis@block{ alerted}}
468 | \setbeamertemplate{block example begin}{\metropolis@block{ example}}
469 | \setbeamertemplate{block end}{\end{beamercolorbox}\vspace*{0.2ex}}
470 | \setbeamertemplate{block alerted end}{\end{beamercolorbox}\vspace*{0.2ex}}
471 | \setbeamertemplate{block example end}{\end{beamercolorbox}\vspace*{0.2ex}}
472 | % \end{macrocode}
473 | % \end{macro}
474 | % \end{macro}
475 | % \end{macro}
476 | %
477 | %
478 | %
479 | % \subsubsection{Lists and floats}
480 | %
481 | % \begin{macrocode}
482 | \setbeamertemplate{itemize items}{\textbullet}
483 | \setbeamertemplate{caption label separator}{: }
484 | \setbeamertemplate{caption}[numbered]
485 | % \end{macrocode}
486 | %
487 | %
488 | %
489 | % \subsubsection{Footnotes}
490 | % \begin{macrocode}
491 | \setbeamertemplate{footnote}{%
492 | \parindent 0em\noindent%
493 | \raggedright
494 | \usebeamercolor{footnote}\hbox to 0.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
495 | }
496 | % \end{macrocode}
497 | %
498 | %
499 | %
500 | % \subsubsection{Text and spacing settings}
501 | %
502 | % \begin{macrocode}
503 | \newlength{\metropolis@parskip}
504 | \setlength{\metropolis@parskip}{0.5em}
505 | \setlength{\parskip}{\metropolis@parskip}
506 | \linespread{1.15}
507 | % \end{macrocode}
508 | %
509 | % By default, Beamer frames offer the |c| option to \textit{almost} vertically
510 | % center the text, but the placement is a little too high. To fix this, we
511 | % redefine the |c| option to equalize |\beamer@frametopskip| and
512 | % |\beamer@framebottomskip|. This solution was suggested by Enrico Gregorio in
513 | % an answer to \href{http://tex.stackexchange.com/questions/247826/}{this
514 | % Stack Exchange question}.
515 | %
516 | % \begin{macrocode}
517 | \define@key{beamerframe}{c}[true]{% centered
518 | \beamer@frametopskip=0pt plus 1fill\relax%
519 | \beamer@framebottomskip=0pt plus 1fill\relax%
520 | \beamer@frametopskipautobreak=0pt plus .4\paperheight\relax%
521 | \beamer@framebottomskipautobreak=0pt plus .6\paperheight\relax%
522 | \def\beamer@initfirstlineunskip{}%
523 | }
524 | % \end{macrocode}
525 | %
526 | %
527 | %
528 | % \subsubsection{Standout frames}
529 | %
530 | % \themename offers a custom frame format with large, centered text and an
531 | % inverted background. To use it, add the key |standout| to the frame:
532 | % |\begin{frame}[standout] ... \end{frame}|.
533 | %
534 | % \begin{macro}{standout}
535 | %
536 | % Optional arguments to Beamer's frames are implemented using
537 | % |\define@key| from the |keyval| package, which will execute code when the
538 | % defined option is called. For the |standout| option, we begin a group,
539 | % change the colors and set frame options.
540 | %
541 | % \begin{macrocode}
542 | \providebool{metropolis@standout}
543 | \define@key{beamerframe}{standout}[true]{%
544 | \booltrue{metropolis@standout}
545 | \begingroup
546 | \setkeys{beamerframe}{c}
547 | \setkeys{beamerframe}{noframenumbering}
548 | \ifbeamercolorempty[bg]{palette primary}{
549 | \setbeamercolor{background canvas}{
550 | use=palette primary,
551 | bg=-palette primary.fg
552 | }
553 | }{
554 | \setbeamercolor{background canvas}{
555 | use=palette primary,
556 | bg=palette primary.bg
557 | }
558 | }
559 | \setbeamercolor{local structure}{
560 | fg=palette primary.fg
561 | }
562 | \usebeamercolor[fg]{palette primary}
563 | }
564 | % \end{macrocode}
565 | %
566 | % Then we just have to close the group after the standout slide is finished
567 | % in order to restore the colours and fonts for the rest of the
568 | % presentation. Unfortunately, we cannot use \AfterEndEnvironment{frame} for
569 | % this (see \url{http://tex.stackexchange.com/questions/226319/}).
570 | % Instead, we prepend the |\endgroup| to |\beamer@reseteecodes|, which is run
571 | % exactly once at the end of each slide.
572 | %
573 | % \begin{macrocode}
574 | \pretocmd{\beamer@reseteecodes}{%
575 | \ifbool{metropolis@standout}{
576 | \endgroup
577 | \boolfalse{metropolis@standout}
578 | }{}
579 | }{}{}
580 | % \end{macrocode}
581 | %
582 | % We set the fonts and the \centering alignment on the inner content,
583 | % in such a way that the speaker's note layout isn't affected by the custom
584 | % formatting.
585 | %
586 | % \begin{macrocode}
587 | \AtBeginEnvironment{beamer@frameslide}{
588 | \ifbool{metropolis@standout}{
589 | \centering
590 | \usebeamerfont{standout}
591 | }{}
592 | }
593 | % \end{macrocode}
594 | % \end{macro}
595 | %
596 | % \subsubsection{Process package options}
597 | %
598 | % \begin{macrocode}
599 | \metropolis@inner@setdefaults
600 | \ProcessPgfPackageOptions{/metropolis/inner}
601 | % \end{macrocode}
602 | %
603 | % \iffalse
604 | %
605 | % \fi
606 | % \Finale
607 | \endinput
608 |
--------------------------------------------------------------------------------
/source/beamerouterthememetropolis.dtx:
--------------------------------------------------------------------------------
1 | % \iffalse meta-comment -------------------------------------------------------
2 | % Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
3 | % contributors can be found at
4 | %
5 | % https://github.com/matze/mtheme/graphs/contributors
6 | %
7 | % and the original template was based on the HSRM theme by Benjamin Weiss.
8 | %
9 | % This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
10 | % International License (https://creativecommons.org/licenses/by-sa/4.0/).
11 | % ------------------------------------------------------------------------- \fi
12 | % \iffalse
13 | %<*package>
14 | \NeedsTeXFormat{LaTeX2e}
15 | \ProvidesPackage{beamerouterthememetropolis}[2017/01/23 Metropolis outer theme]
16 | %
17 | % \fi
18 | % \CheckSum{0}
19 | % \StopEventually{}
20 | % \iffalse
21 | %<*package>
22 | % ------------------------------------------------------------------------- \fi
23 | %
24 | % \subsection{\themename outer theme}
25 | %
26 | % A |beamer| outer theme dictates the style of the frame elements traditionally
27 | % set outside the body of each slide: the head, footline, and frame title.
28 | %
29 | %
30 | %
31 | % \subsubsection{Package dependencies}
32 | %
33 | % \begin{macrocode}
34 | \RequirePackage{etoolbox}
35 | \RequirePackage{calc}
36 | \RequirePackage{pgfopts}
37 | % \end{macrocode}
38 | %
39 | %
40 | %
41 | % \subsubsection{Options}
42 | %
43 | % \begin{macro}{numbering}
44 | % Adds slide numbers to the bottom right of each slide.
45 | % \begin{macrocode}
46 | \pgfkeys{
47 | /metropolis/outer/numbering/.cd,
48 | .is choice,
49 | none/.code=\setbeamertemplate{frame numbering}[none],
50 | counter/.code=\setbeamertemplate{frame numbering}[counter],
51 | fraction/.code=\setbeamertemplate{frame numbering}[fraction],
52 | }
53 | % \end{macrocode}
54 | % \end{macro}
55 | %
56 | % \begin{macro}{progressbar}
57 | % Adds a progress bar to the top, bottom, or frametitle of each slide.
58 | % \begin{macrocode}
59 | \pgfkeys{
60 | /metropolis/outer/progressbar/.cd,
61 | .is choice,
62 | none/.code={%
63 | \setbeamertemplate{headline}[plain]
64 | \setbeamertemplate{frametitle}[plain]
65 | \setbeamertemplate{footline}[plain]
66 | },
67 | head/.code={\pgfkeys{/metropolis/outer/progressbar=none}
68 | \addtobeamertemplate{headline}{}{%
69 | \usebeamertemplate*{progress bar in head/foot}
70 | }
71 | },
72 | frametitle/.code={\pgfkeys{/metropolis/outer/progressbar=none}
73 | \addtobeamertemplate{frametitle}{}{%
74 | \usebeamertemplate*{progress bar in head/foot}
75 | }
76 | },
77 | foot/.code={\pgfkeys{/metropolis/outer/progressbar=none}
78 | \addtobeamertemplate{footline}{}{%
79 | \usebeamertemplate*{progress bar in head/foot}%
80 | }
81 | },
82 | }
83 | % \end{macrocode}
84 | % \end{macro}
85 | %
86 | % \begin{macro}{\metropolis@outer@setdefaults}
87 | % Sets default values for outer theme options.
88 | % \begin{macrocode}
89 | \newcommand{\metropolis@outer@setdefaults}{
90 | \pgfkeys{/metropolis/outer/.cd,
91 | numbering=counter,
92 | progressbar=none,
93 | }
94 | }
95 | % \end{macrocode}%
96 | % \end{macro}
97 | %
98 | %
99 | %
100 | % \subsubsection{Head and footline}
101 | %
102 | % All good |beamer| presentations should already remove the navigation symbols,
103 | % but \themename removes them automatically (just in case).
104 | %
105 | % \begin{macrocode}
106 | \setbeamertemplate{navigation symbols}{}
107 | % \end{macrocode}
108 | %
109 | % \begin{macro}{frame numbering}
110 | % Templates for the frame number. Can be omitted, shown or displayed as a
111 | % fraction of the total frames.
112 | % \begin{macrocode}
113 | \defbeamertemplate{frame footer}{none}{}
114 | \defbeamertemplate{frame footer}{custom}[1]{ #1 }
115 | % \end{macrocode}
116 | %
117 | % \begin{macrocode}
118 | \defbeamertemplate{frame numbering}{none}{}
119 | \defbeamertemplate{frame numbering}{counter}{\insertframenumber}
120 | \defbeamertemplate{frame numbering}{fraction}{
121 | \insertframenumber/\inserttotalframenumber
122 | }
123 | % \end{macrocode}
124 | % \end{macro}
125 | %
126 | % \begin{macro}{headline}
127 | % \begin{macro}{footline}
128 | % Templates for the head- and footline at the top and bottom of each frame.
129 | % \begin{macrocode}
130 | \defbeamertemplate{headline}{plain}{}
131 | \defbeamertemplate{footline}{plain}{%
132 | \begin{beamercolorbox}[wd=\textwidth, sep=3ex]{footline}%
133 | \usebeamerfont{page number in head/foot}%
134 | \usebeamertemplate*{frame footer}
135 | \hfill%
136 | \usebeamertemplate*{frame numbering}
137 | \end{beamercolorbox}%
138 | }
139 | % \end{macrocode}
140 | % \end{macro}
141 | % \end{macro}
142 | %
143 | %
144 | %
145 | % \subsubsection{Frametitle}
146 | %
147 | % \begin{macro}{frametitle}
148 | % Templates for the frame title, which is optionally underlined with a
149 | % progress bar.
150 | % \begin{macrocode}
151 | \newlength{\metropolis@frametitle@padding}
152 | \setlength{\metropolis@frametitle@padding}{2.2ex}
153 | \newcommand{\metropolis@frametitlestrut@start}{
154 | \rule{0pt}{\metropolis@frametitle@padding +%
155 | \totalheightof{%
156 | \ifcsdef{metropolis@frametitleformat}{\metropolis@frametitleformat X}{X}%
157 | }%
158 | }%
159 | }
160 | \newcommand{\metropolis@frametitlestrut@end}{
161 | \rule[-\metropolis@frametitle@padding]{0pt}{\metropolis@frametitle@padding}
162 | }
163 | \defbeamertemplate{frametitle}{plain}{%
164 | \nointerlineskip%
165 | \begin{beamercolorbox}[%
166 | wd=\paperwidth,%
167 | sep=0pt,%
168 | leftskip=\metropolis@frametitle@padding,%
169 | rightskip=\metropolis@frametitle@padding,%
170 | ]{frametitle}%
171 | \metropolis@frametitlestrut@start%
172 | \insertframetitle%
173 | \nolinebreak%
174 | \metropolis@frametitlestrut@end%
175 | \end{beamercolorbox}%
176 | }
177 | \setbeamertemplate{frametitle continuation}{%
178 | \usebeamerfont{frametitle}
179 | \romannumeral \insertcontinuationcount
180 | }
181 | % \end{macrocode}
182 | % \end{macro}
183 | %
184 | % \begin{macro}{progress bar in head/foot}
185 | % Template for the progress bar optionally displayed below the frame title
186 | % on each page. Much of this code is duplicated in the inner theme's
187 | % template |progress bar in section page|.
188 | % \begin{macrocode}
189 | \newlength{\metropolis@progressinheadfoot}
190 | \newlength{\metropolis@progressinheadfoot@linewidth}
191 | \setlength{\metropolis@progressinheadfoot@linewidth}{0.4pt}
192 | \setbeamertemplate{progress bar in head/foot}{
193 | \nointerlineskip
194 | \setlength{\metropolis@progressinheadfoot}{%
195 | \paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
196 | }%
197 | \begin{beamercolorbox}[wd=\paperwidth]{progress bar in head/foot}
198 | \tikzexternaldisable%
199 | \begin{tikzpicture}
200 | \fill[bg] (0,0) rectangle (\paperwidth, \metropolis@progressinheadfoot@linewidth);
201 | \fill[fg] (0,0) rectangle (\metropolis@progressinheadfoot, \metropolis@progressinheadfoot@linewidth);
202 | \end{tikzpicture}%
203 | \tikzexternalenable%
204 | \end{beamercolorbox}
205 | }
206 | % \end{macrocode}
207 | % \end{macro}
208 | %
209 | %
210 | %
211 | % \begin{macro}{appendix}
212 | % Removes page numbering and per-slide progress bars when |\appendix| is
213 | % called. This makes it easier to include additional ``backup slides'' at
214 | % the end of the presentation, especially in conjunction with the package
215 | % |appendixnumberbeamer|.
216 | % \begin{macrocode}
217 | \AtBeginDocument{%
218 | \apptocmd{\appendix}{%
219 | \pgfkeys{%
220 | /metropolis/outer/.cd,
221 | numbering=none,
222 | progressbar=none}
223 | }{}{}
224 | }
225 | % \end{macrocode}
226 | % \end{macro}
227 | % \subsubsection{Process package options}
228 | %
229 | % \begin{macrocode}
230 | \metropolis@outer@setdefaults
231 | \ProcessPgfPackageOptions{/metropolis/outer}
232 | % \end{macrocode}
233 | %
234 | % \iffalse
235 | %
236 | % \fi
237 | % \Finale
238 | \endinput
239 |
--------------------------------------------------------------------------------
/source/beamerthememetropolis.dtx:
--------------------------------------------------------------------------------
1 | % \iffalse meta-comment -------------------------------------------------------
2 | % Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
3 | % contributors can be found at
4 | %
5 | % https://github.com/matze/mtheme/graphs/contributors
6 | %
7 | % and the original template was based on the HSRM theme by Benjamin Weiss.
8 | %
9 | % This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
10 | % International License (https://creativecommons.org/licenses/by-sa/4.0/).
11 | % ------------------------------------------------------------------------- \fi
12 | % \iffalse
13 | %<*package>
14 | \NeedsTeXFormat{LaTeX2e}
15 | \ProvidesPackage{beamerthememetropolis}
16 | [2017/01/23 v1.2 Metropolis Beamer theme]
17 | %
18 | % \fi
19 | % \CheckSum{0}
20 | % \StopEventually{}
21 | % \iffalse
22 | %<*package>
23 | % ------------------------------------------------------------------------- \fi
24 | %
25 | % \subsection{\themename parent theme}
26 | %
27 | % The primary job of this package is to load the component sub-packages of the
28 | % \themename theme and route the theme options accordingly. It also
29 | % provides some custom commands and environments for the user.
30 | %
31 | %
32 | %
33 | % \subsubsection{Package dependencies}
34 | %
35 | % \begin{macrocode}
36 | \RequirePackage{etoolbox}
37 | \RequirePackage{pgfopts}
38 | % \end{macrocode}
39 | %
40 | %
41 | %
42 | % \subsubsection{Options}
43 | %
44 | % Most options are passed off to the component sub-packages.
45 | %
46 | % \begin{macrocode}
47 | \pgfkeys{/metropolis/.cd,
48 | .search also={
49 | /metropolis/inner,
50 | /metropolis/outer,
51 | /metropolis/color,
52 | /metropolis/font,
53 | }
54 | }
55 | % \end{macrocode}
56 | %
57 | % \begin{macro}{titleformat plain}
58 | % Controls the formatting of the text on standout ``plain'' frames.
59 | % \begin{macrocode}
60 | \pgfkeys{
61 | /metropolis/titleformat plain/.cd,
62 | .is choice,
63 | regular/.code={%
64 | \let\metropolis@plaintitleformat\@empty%
65 | \setbeamerfont{standout}{shape=\normalfont}%
66 | },
67 | smallcaps/.code={%
68 | \let\metropolis@plaintitleformat\@empty%
69 | \setbeamerfont{standout}{shape=\scshape}%
70 | },
71 | allsmallcaps/.code={%
72 | \let\metropolis@plaintitleformat\MakeLowercase%
73 | \setbeamerfont{standout}{shape=\scshape}%
74 | \PackageWarning{beamerthememetropolis}{%
75 | Be aware that titleformat plain=allsmallcaps can lead to problems%
76 | }
77 | },
78 | allcaps/.code={%
79 | \let\metropolis@plaintitleformat\MakeUppercase%
80 | \setbeamerfont{standout}{shape=\normalfont}%
81 | \PackageWarning{beamerthememetropolis}{%
82 | Be aware that titleformat plain=allcaps can lead to problems%
83 | }
84 | },
85 | }
86 | % \end{macrocode}
87 | % \end{macro}
88 | %
89 | % \begin{macro}{titleformat}
90 | % Sets a standard format for titles, subtitles, section titles, frame
91 | % titles, and the text on standout ``plain'' frames.
92 | % \begin{macrocode}
93 | \pgfkeys{
94 | /metropolis/titleformat/.code=\pgfkeysalso{
95 | font/titleformat title=#1,
96 | font/titleformat subtitle=#1,
97 | font/titleformat section=#1,
98 | font/titleformat frame=#1,
99 | titleformat plain=#1,
100 | }
101 | }
102 | % \end{macrocode}
103 | % \end{macro}
104 | %
105 | % For backwards compatibility with earlier betas of the theme, we implement
106 | % deprecated option names as aliases to the corresponding |key=value| options.
107 | %
108 | % \begin{macrocode}
109 | \pgfkeys{/metropolis/.cd,
110 | usetitleprogressbar/.code=\pgfkeysalso{outer/progressbar=frametitle},
111 | noslidenumbers/.code=\pgfkeysalso{outer/numbering=none},
112 | usetotalslideindicator/.code=\pgfkeysalso{outer/numbering=fraction},
113 | nosectionslide/.code=\pgfkeysalso{inner/sectionpage=none},
114 | darkcolors/.code=\pgfkeysalso{color/background=dark},
115 | blockbg/.code=\pgfkeysalso{color/block=fill, inner/block=fill},
116 | }
117 | % \end{macrocode}
118 | %
119 | % Set default values for options.
120 | %
121 | % \begin{macrocode}
122 | \newcommand{\metropolis@setdefaults}{
123 | \pgfkeys{/metropolis/.cd,
124 | titleformat plain=regular,
125 | }
126 | }
127 | % \end{macrocode}
128 | %
129 | % To avoid generating externalized figures of the progressbar we have to disable
130 | % them with ``tikzexternalenable'' and ``tikzexternaldisable''. However, if the
131 | % ``external'' libray is not loaded we would get undefined control sequence
132 | % problems, hence we define them as no-ops if they are not defined yet.
133 | %
134 | % \begin{macrocode}
135 | \providecommand{\tikzexternalenable}{}
136 | \providecommand{\tikzexternaldisable}{}
137 | % \end{macrocode}
138 | %
139 | % \subsubsection{Component sub-packages}
140 | %
141 | % Having processed the options, we can now load the component sub-packages of
142 | % the theme.
143 | %
144 | % \begin{macrocode}
145 | \useinnertheme{metropolis}
146 | \useoutertheme{metropolis}
147 | \usecolortheme{metropolis}
148 | \usefonttheme{metropolis}
149 | % \end{macrocode}
150 | %
151 | % The |tol| theme for |pgfplots| is only loaded if |pgfplots| is used.
152 | %
153 | % \begin{macrocode}
154 | \AtEndPreamble{%
155 | \@ifpackageloaded{pgfplots}{%
156 | \RequirePackage{pgfplotsthemetol}
157 | }{}
158 | }
159 | % \end{macrocode}
160 | %
161 | %
162 | %
163 | % \subsubsection{Custom commands}
164 | %
165 | % The parent theme defines custom commands as their proper usage may depend
166 | % on multiple sub-packages.
167 | %
168 | % \begin{macro}{\metroset}
169 | % Allows the user to change options midway through a presentation.
170 | % \begin{macrocode}
171 | \newcommand{\metroset}[1]{\pgfkeys{/metropolis/.cd,#1}}
172 | % \end{macrocode}
173 | % \end{macro}
174 | %
175 | % \begin{macro}{\plain}
176 | % Creates a plain frame with dark background, suitable for displaying images
177 | % or a few words. The format of the text can be set with the
178 | % |titleformat plain| option.
179 | % \begin{macrocode}
180 | \def\metropolis@plaintitleformat#1{#1}
181 | \newcommand{\plain}[2][]{%
182 | \PackageWarning{beamerthememetropolis}{%
183 | The syntax `\plain' may be deprecated in a future version of Metropolis.
184 | Please use a frame with [standout] instead.
185 | }
186 | \begin{frame}[standout]{#1}
187 | \metropolis@plaintitleformat{#2}
188 | \end{frame}
189 | }
190 | % \end{macrocode}
191 | % \end{macro}
192 | %
193 | % \begin{macro}{\mreducelistspacing}
194 | % \begin{macrocode}
195 | \newcommand{\mreducelistspacing}{\vspace{-\topsep}}
196 | % \end{macrocode}
197 | % \end{macro}
198 | %
199 | %
200 | %
201 | % \subsubsection{Process package options}
202 | %
203 | % \begin{macrocode}
204 | \metropolis@setdefaults
205 | \ProcessPgfOptions{/metropolis}
206 | % \end{macrocode}
207 | %
208 | % \iffalse
209 | %
210 | % \fi
211 | % \Finale
212 | \endinput
213 |
--------------------------------------------------------------------------------
/source/beamerthememetropolis.ins:
--------------------------------------------------------------------------------
1 | %% ---------------------------------------------------------------------------
2 | %% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
3 | %% contributors can be found at
4 | %%
5 | %% https://github.com/matze/mtheme/graphs/contributors
6 | %%
7 | %% and the original template was based on the HSRM theme by Benjamin Weiss.
8 | %%
9 | %% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
10 | %% International License (https://creativecommons.org/licenses/by-sa/4.0/).
11 | %% ---------------------------------------------------------------------------
12 |
13 | \input docstrip.tex %
14 | \keepsilent
15 | \askforoverwritefalse
16 | \usedir{tex/latex/mtheme}
17 |
18 | \preamble
19 | ---------------------------------------------------------------------------
20 | Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
21 | contributors can be found at
22 |
23 | https://github.com/matze/mtheme/graphs/contributors
24 |
25 | and the original template was based on the HSRM theme by Benjamin Weiss.
26 |
27 | This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
28 | International License (https://creativecommons.org/licenses/by-sa/4.0/).
29 | ---------------------------------------------------------------------------
30 | \endpreamble
31 |
32 | \generate{\file{beamerthememetropolis.sty}{%
33 | \from{beamerthememetropolis.dtx}{package}}
34 | }
35 | \generate{\file{beamerinnerthememetropolis.sty}{%
36 | \from{beamerinnerthememetropolis.dtx}{package}}
37 | }
38 | \generate{\file{beamerouterthememetropolis.sty}{%
39 | \from{beamerouterthememetropolis.dtx}{package}}
40 | }
41 | \generate{\file{beamerfontthememetropolis.sty}{%
42 | \from{beamerfontthememetropolis.dtx}{package}}
43 | }
44 | \generate{\file{beamercolorthememetropolis.sty}{%
45 | \from{beamercolorthememetropolis.dtx}{package}}
46 | }
47 | \generate{\file{beamercolorthememetropolis-highcontrast.sty}{%
48 | \from{beamercolorthememetropolis-highcontrast.dtx}{package}}
49 | }
50 | \generate{\file{pgfplotsthemetol.sty}{%
51 | \from{pgfplotsthemetol.dtx}{package}}
52 | }
53 |
54 | \obeyspaces
55 | \Msg{**************************************************************}
56 | \Msg{* *}
57 | \Msg{* To finish the installation you have to move the following *}
58 | \Msg{* files into a directory searched by TeX: *}
59 | \Msg{* *}
60 | \Msg{* beamerthememetropolis.sty *}
61 | \Msg{* beamerinnerthememetropolis.sty *}
62 | \Msg{* beamerouterthememetropolis.sty *}
63 | \Msg{* beamerfontthememetropolis.sty *}
64 | \Msg{* beamercolorthememetropolis.sty *}
65 | \Msg{* pgfplotsthemetol.sty *}
66 | \Msg{* *}
67 | \Msg{* To produce the documentation run the file mtheme.dtx *}
68 | \Msg{* through LaTeX. *}
69 | \Msg{* *}
70 | \Msg{* Happy TeXing! *}
71 | \Msg{* *}
72 | \Msg{**************************************************************}
73 |
74 | \endbatchfile
75 |
--------------------------------------------------------------------------------
/source/pgfplotsthemetol.dtx:
--------------------------------------------------------------------------------
1 | % \iffalse meta-comment -------------------------------------------------------
2 | % Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
3 | % contributors can be found at
4 | %
5 | % https://github.com/matze/mtheme/graphs/contributors
6 | %
7 | % and these colors were inspired by the Paul Tol 21-color Salute by Peter Carl.
8 | %
9 | % http://www.r-bloggers.com/the-paul-tol-21-color-salute/
10 | %
11 | % This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
12 | % International License (https://creativecommons.org/licenses/by-sa/4.0/).
13 | % ------------------------------------------------------------------------- \fi
14 | % \iffalse
15 | % \ProvidesFile{pgfplotsthemetol.dtx}
16 | %<*package>
17 | \NeedsTeXFormat{LaTeX2e}
18 | \ProvidesPackage{pgfplotsthemetol}
19 | [2017/01/23 PGFplots colors based on Paul Tol's SRON technical note]
20 | %
21 | % \documentclass{ltxdoc}
22 | % \usepackage{pgfplotsthemetol}
23 | % \begin{document}
24 | % \DocInput{pgfplotsthemetol.dtx}
25 | % \end{document}
26 | % \fi
27 | % \CheckSum{0}
28 | % \StopEventually{}
29 | % \iffalse
30 | %<*package>
31 | % ------------------------------------------------------------------------- \fi
32 | %
33 | % \subsection{Tol \texttt{pgfplots} theme}
34 | %
35 | % Paul Tol's 12-color palette\footnote{Tol actually describes several
36 | % palettes; these colours are taken from the bottom row of Figure 3 in his
37 | % technical note.} is as follows:
38 | %
39 | % \begin{macrocode}
40 | \definecolor{TolDarkPurple}{HTML}{332288}
41 | \definecolor{TolDarkBlue}{HTML}{6699CC}
42 | \definecolor{TolLightBlue}{HTML}{88CCEE}
43 | \definecolor{TolLightGreen}{HTML}{44AA99}
44 | \definecolor{TolDarkGreen}{HTML}{117733}
45 | \definecolor{TolDarkBrown}{HTML}{999933}
46 | \definecolor{TolLightBrown}{HTML}{DDCC77}
47 | \definecolor{TolDarkRed}{HTML}{661100}
48 | \definecolor{TolLightRed}{HTML}{CC6677}
49 | \definecolor{TolLightPink}{HTML}{AA4466}
50 | \definecolor{TolDarkPink}{HTML}{882255}
51 | \definecolor{TolLightPurple}{HTML}{AA4499}
52 | % \end{macrocode}
53 | %
54 | % To use these colors, we describe ``cycle lists'' from which PGF chooses
55 | % styles for the different series in a chart.
56 | %
57 | % \begin{macro}{mbarplot cycle}
58 | % Colors and styles intended for bar charts with up to 12 series.
59 | %
60 | % \begin{macrocode}
61 | \pgfplotscreateplotcyclelist{mbarplot cycle}{%
62 | {draw=TolDarkBlue, fill=TolDarkBlue!70},
63 | {draw=TolLightBrown, fill=TolLightBrown!70},
64 | {draw=TolLightGreen, fill=TolLightGreen!70},
65 | {draw=TolDarkPink, fill=TolDarkPink!70},
66 | {draw=TolDarkPurple, fill=TolDarkPurple!70},
67 | {draw=TolDarkRed, fill=TolDarkRed!70},
68 | {draw=TolDarkBrown, fill=TolDarkBrown!70},
69 | {draw=TolLightRed, fill=TolLightRed!70},
70 | {draw=TolLightPink, fill=TolLightPink!70},
71 | {draw=TolLightPurple, fill=TolLightPurple!70},
72 | {draw=TolLightBlue, fill=TolLightBlue!70},
73 | {draw=TolDarkGreen, fill=TolDarkGreen!70},
74 | }
75 | % \end{macrocode}
76 | % \end{macro}
77 | %
78 | % \begin{macro}{mlineplot cycle}
79 | % Colors and styles intended for line charts with up to 4 series.
80 | % \begin{macrocode}
81 | \pgfplotscreateplotcyclelist{mlineplot cycle}{%
82 | {TolDarkBlue, mark=*, mark size=1.5pt},
83 | {TolLightBrown, mark=square*, mark size=1.3pt},
84 | {TolLightGreen, mark=triangle*, mark size=1.5pt},
85 | {TolDarkBrown, mark=diamond*, mark size=1.5pt},
86 | }
87 | % \end{macrocode}
88 | % \end{macro}
89 | %
90 | % However, the above cycle lists are not applied automatically. We still need
91 | % to define styles --- |mlineplot| and |mbarplot| --- that the user can apply
92 | % to the axis of a |pgfplots| chart to use the colors. We'll also take the
93 | % opportunity to adjust the display of chart axes when these styles are used.
94 | %
95 | % \begin{macrocode}
96 | \pgfplotsset{
97 | compat=1.9,
98 | % \end{macrocode}
99 | %
100 | % \begin{macro}{mlineplot}
101 | % A style to apply to the axis of a PGF line plot.
102 | % \begin{macrocode}
103 | mlineplot/.style={
104 | mbaseplot,
105 | xmajorgrids=true,
106 | ymajorgrids=true,
107 | major grid style={dotted},
108 | axis x line=bottom,
109 | axis y line=left,
110 | legend style={
111 | cells={anchor=west},
112 | draw=none
113 | },
114 | cycle list name=mlineplot cycle,
115 | },
116 | % \end{macrocode}
117 | % \end{macro}
118 | % \begin{macro}{mbarplot}
119 | % \begin{macro}{horizontal mbarplot}
120 | % A style to apply to the axis of a PGF bar chart. |mbarplot| uses vertical
121 | % bars by default, while |horizontal mbarplot| has horizontal bars as the
122 | % name implies. Their shared properties are factored out into the internal
123 | % style |mbarplot base|.
124 | %
125 | % \begin{macrocode}
126 | mbarplot base/.style={
127 | mbaseplot,
128 | bar width=6pt,
129 | axis y line*=none,
130 | },
131 | mbarplot/.style={
132 | mbarplot base,
133 | ybar,
134 | xmajorgrids=false,
135 | ymajorgrids=true,
136 | area legend,
137 | legend image code/.code={%
138 | \draw[#1] (0cm,-0.1cm) rectangle (0.15cm,0.1cm);
139 | },
140 | cycle list name=mbarplot cycle,
141 | },
142 | horizontal mbarplot/.style={
143 | mbarplot base,
144 | xmajorgrids=true,
145 | ymajorgrids=false,
146 | xbar stacked,
147 | area legend,
148 | legend image code/.code={%
149 | \draw[#1] (0cm,-0.1cm) rectangle (0.15cm,0.1cm);
150 | },
151 | cycle list name=mbarplot cycle,
152 | },
153 | % \end{macrocode}
154 | % \end{macro}
155 | % \end{macro}
156 | % \begin{macro}{mbaseplot}
157 | % Adjusts the appearance of the axes in a PGF chart.
158 | % \begin{macrocode}
159 | mbaseplot/.style={
160 | legend style={
161 | draw=none,
162 | fill=none,
163 | cells={anchor=west},
164 | },
165 | x tick label style={
166 | font=\footnotesize
167 | },
168 | y tick label style={
169 | font=\footnotesize
170 | },
171 | legend style={
172 | font=\footnotesize
173 | },
174 | major grid style={
175 | dotted,
176 | },
177 | axis x line*=bottom,
178 | },
179 | disable thousands separator/.style={
180 | /pgf/number format/.cd,
181 | 1000 sep={}
182 | },
183 | }
184 | % \end{macrocode}
185 | % \end{macro}
186 | % \iffalse
187 | %
188 | % \fi
189 | % \Finale
190 | \endinput
191 |
--------------------------------------------------------------------------------