From 85ee8c199f2c14ef10dd75bd71157faa5cb51bf6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 5 Dec 2015 23:05:44 +0000 Subject: beamertheme-metropolis (6dec15) git-svn-id: svn://tug.org/texlive/trunk@39020 c570f23f-e606-0410-a88d-b1316a301751 --- .../beamerouterthememetropolis.dtx | 268 +++++++++++++++++++++ 1 file changed, 268 insertions(+) create mode 100644 Master/texmf-dist/source/latex/beamertheme-metropolis/beamerouterthememetropolis.dtx (limited to 'Master/texmf-dist/source/latex/beamertheme-metropolis/beamerouterthememetropolis.dtx') diff --git a/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerouterthememetropolis.dtx b/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerouterthememetropolis.dtx new file mode 100644 index 00000000000..2b3df9d73fd --- /dev/null +++ b/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerouterthememetropolis.dtx @@ -0,0 +1,268 @@ +% \iffalse meta-comment ------------------------------------------------------- +% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of +% contributors can be found at +% +% https://github.com/matze/mtheme/graphs/contributors +% +% and the original template was based on the HSRM theme by Benjamin Weiss. +% +% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 +% International License (https://creativecommons.org/licenses/by-sa/4.0/). +% ------------------------------------------------------------------------- \fi +% \iffalse +% \ProvidesFile{beamerouterthememetropolis.dtx} +%<*package> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{beamerouterthememetropolis}[2015/12/04 Metropolis outer theme] +% +% \documentclass{ltxdoc} +% \usepackage{beamerouterthememetropolis} +% \begin{document} +% \DocInput{beamerouterthememetropolis.dtx} +% \end{document} +% \fi +% \CheckSum{0} +% \StopEventually{} +% \iffalse +%<*package> +% ------------------------------------------------------------------------- \fi +% +% \subsection{\textsc{metropolis} outer theme} +% +% A |beamer| outer theme dictates the style of the frame elements traditionally +% set outside the body of each slide: the head, footline, and frame title. +% +% Load required packages. +% \begin{macrocode} +\RequirePackage{etoolbox} +\RequirePackage{calc} +\RequirePackage{pgfopts} +% \end{macrocode} +% +% +% +% \subsubsection{Options} +% +% \begin{macro}{numbering} +% This option controls the page numbering. +% \begin{macrocode} +\pgfkeys{ + /metropolis/outer/numbering/.cd, + .is choice, + none/.code=\setbeamertemplate{frame numbering}[none], + counter/.code=\setbeamertemplate{frame numbering}[counter], + fraction/.code=\setbeamertemplate{frame numbering}[fraction], +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{progressbar} +% This option controls the progressbar. +% \begin{macrocode} +\pgfkeys{ + /metropolis/outer/progressbar/.cd, + .is choice, + none/.code={% + \setbeamertemplate{headline}[plain] + \setbeamertemplate{frametitle}[plain] + \setbeamertemplate{footline}[plain] + }, + head/.code={\pgfkeys{/metropolis/outer/progressbar=none} + \addtobeamertemplate{headline}{}{% + \usebeamertemplate*{progress bar in head/foot} + } + }, + frametitle/.code={\pgfkeys{/metropolis/outer/progressbar=none} + \addtobeamertemplate{frametitle}{}{% + \usebeamertemplate*{progress bar in head/foot} + } + }, + foot/.code={\pgfkeys{/metropolis/outer/progressbar=none} + \addtobeamertemplate{footline}{}{% + \usebeamertemplate*{progress bar in head/foot}% + } + }, +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{frametitleformat} +% Control the titleformat of the frame title +% \begin{macrocode} +\pgfkeys{ + /metropolis/outer/titleformat frame/.cd, + .is choice, + regular/.code={% + \let\@metropolis@frametitleformat\@empty% + \setbeamerfont{frametitle}{shape=\normalfont}% + \renewcommand{\@metropolis@frametitlestrut}{% + \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}% + } + }, + smallcaps/.code={% + \let\@metropolis@frametitleformat\@empty% + \setbeamerfont{frametitle}{shape=\scshape}% + \renewcommand{\@metropolis@frametitlestrut}{% + \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}% + } + }, + allsmallcaps/.code={% + \let\@metropolis@frametitleformat\MakeLowercase% + \setbeamerfont{frametitle}{shape=\scshape}% + \renewcommand{\@metropolis@frametitlestrut}{% + \vphantom{abcdefghijklmnopqrstuvwxyz}% + } + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat frame=allsmallcaps can lead to problems% + } + }, + allcaps/.code={% + \let\@metropolis@frametitleformat\MakeUppercase% + \setbeamerfont{frametitle}{shape=\normalfont} + \renewcommand{\@metropolis@frametitlestrut}{% + \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZ}% + } + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat frame=allcaps can lead to problems% + } + }, +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@metropolis@outer@setdefaults} +% Set default values for outer theme options. +% \begin{macrocode} +\newcommand{\@metropolis@outer@setdefaults}{ + \pgfkeys{/metropolis/outer/.cd, + numbering=counter, + progressbar=none, + titleformat frame=regular, + } +} +% \end{macrocode}% +% \end{macro} +% +% +% +% \subsubsection{Head and footline} +% +% All good |beamer| presentations should already remove the navigation symbols, +% but \textsc{metropolis} removes them automatically (just in case). +% +% \begin{macrocode} +\setbeamertemplate{navigation symbols}{} +% \end{macrocode} +% +% Templates for the frame number. Can be omitted, shown or displayed as a +% fraction of the total frames. +% +% \begin{macrocode} +\defbeamertemplate{frame numbering}{none}{} +\defbeamertemplate{frame numbering}{counter}{\insertframenumber} +\defbeamertemplate{frame numbering}{fraction}{ + \insertframenumber/\inserttotalframenumber +} +% \end{macrocode} +% +% \begin{macrocode} +\defbeamertemplate{headline}{plain}{} +\defbeamertemplate{footline}{plain}{% + \begin{beamercolorbox}[wd=\textwidth, sep=3ex]{footline}% + \hfill% + \usebeamerfont{page number in head/foot}% + \usebeamertemplate*{frame numbering} + \end{beamercolorbox}% +} +% \end{macrocode} +% +% +% +% \subsubsection{Frametitle} +% +% \begin{macro}{\@metropolis@frametitleformat} +% Define a hook to change the case format of the frame title. +% \begin{macrocode} +\def\@metropolis@frametitleformat#1{#1} +% \end{macrocode} +% \end{macro} +% +% To make the |\MakeLowercase| and |\MakeUppercase| macros work in the +% frame title we have to patch |\beamer@@frametitle|. This solution was +% suggested by Enrico Gregorio in an answer to +% \href{http://tex.stackexchange.com/questions/112526/}{this StackExchange +% question}. +% +% \begin{macrocode} +\patchcmd{\beamer@@frametitle} + {\beamer@ifempty{#2}{}{% + \gdef\insertframetitle{{#2\ifnum\beamer@autobreakcount>0\relax{}\space% + \usebeamertemplate*{frametitle continuation}\fi}}% + \gdef\beamer@frametitle{#2}% + \gdef\beamer@shortframetitle{#1}% + }} + {\beamer@ifempty{#2}{}{% + \gdef\insertframetitle{{\@metropolis@frametitleformat{#2}\ifnum% + \beamer@autobreakcount>0\relax{}\space% + \usebeamertemplate*{frametitle continuation}\fi}}% + \gdef\beamer@frametitle{#2}% + \gdef\beamer@shortframetitle{#1}% + }} + {} + {\PackageError{beamerouterthememetropolis}{Patching frame title failed}} +% \end{macrocode} +% +% \begin{macro}{frametitle} +% +% Templates for the frame title, which is optionally underlined with a +% progress bar. +% +% \begin{macrocode} +\newlength{\@metropolis@frametitlestrut} +\defbeamertemplate{frametitle}{plain}{% + \nointerlineskip% + \begin{beamercolorbox}[% + wd=\paperwidth,% + sep=1.5ex,% + ]{frametitle}% + \@metropolis@frametitlestrut\insertframetitle\@metropolis@frametitlestrut% + \end{beamercolorbox}% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{progress bar in head/foot} +% +% Template for the progress bar optionally displayed below the frame title +% on each page. Much of this code is duplicated in the inner theme's template +% |progress bar in section page|. +% +% \begin{macrocode} +\newlength{\metropolis@progressinheadfoot} +\setbeamertemplate{progress bar in head/foot}{ + \nointerlineskip + \setlength{\metropolis@progressinheadfoot}{% + \paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}% + }% + \begin{beamercolorbox}[wd=\paperwidth]{progress bar in head/foot} + \begin{tikzpicture} + \draw[bg, fill=bg] (0,0) rectangle (\paperwidth, 0.4pt); + \draw[fg, fill=fg] (0,0) rectangle (\metropolis@progressinheadfoot, 0.4pt); + \end{tikzpicture}% + \end{beamercolorbox} +} +% \end{macrocode} +% \end{macro} +% +% Process package options +% +% \begin{macrocode} +\@metropolis@outer@setdefaults +\ProcessPgfPackageOptions{/metropolis/outer} +% \end{macrocode} +% +% \iffalse +% +% \fi +% \Finale +\endinput -- cgit v1.2.3