dotfiles/latex/.config/texmf/tex/latex/metropolis/beamerinnerthememetropolis.sty

298 lines
8.9 KiB
TeX

%%
%% This is file `beamerinnerthememetropolis.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% beamerinnerthememetropolis.dtx (with options: `package')
%% ---------------------------------------------------------------------------
%% 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/).
%% ---------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{beamerinnerthememetropolis}[2017/01/23 Metropolis inner theme]
\RequirePackage{etoolbox}
\RequirePackage{keyval}
\RequirePackage{calc}
\RequirePackage{pgfopts}
\RequirePackage{tikz}
\pgfkeys{
/metropolis/inner/sectionpage/.cd,
.is choice,
none/.code=\metropolis@disablesectionpage,
simple/.code={\metropolis@enablesectionpage
\setbeamertemplate{section page}[simple]},
progressbar/.code={\metropolis@enablesectionpage
\setbeamertemplate{section page}[progressbar]},
}
\pgfkeys{
/metropolis/inner/subsectionpage/.cd,
.is choice,
none/.code=\metropolis@disablesubsectionpage,
simple/.code={\metropolis@enablesubsectionpage
\setbeamertemplate{section page}[simple]},
progressbar/.code={\metropolis@enablesubsectionpage
\setbeamertemplate{section page}[progressbar]},
}
\newcommand{\metropolis@inner@setdefaults}{
\pgfkeys{/metropolis/inner/.cd,
sectionpage=progressbar,
subsectionpage=none
}
}
\setbeamertemplate{title page}{
\begin{minipage}[b][\paperheight]{\textwidth}
\ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi
\vfill%
\ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi
\ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi
\usebeamertemplate*{title separator}
\ifx\beamer@shortauthor\@empty\else\usebeamertemplate*{author}\fi
\ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi
\ifx\insertinstitute\@empty\else\usebeamertemplate*{institute}\fi
\vfill
\vspace*{1mm}
\end{minipage}
}
\def\maketitle{%
\ifbeamer@inframe
\titlepage
\else
\frame[plain,noframenumbering]{\titlepage}
\fi
}
\def\titlepage{%
\usebeamertemplate{title page}
}
\setbeamertemplate{title graphic}{
\vbox to 0pt {
\vspace*{2em}
\inserttitlegraphic%
}%
\nointerlineskip%
}
\setbeamertemplate{title}{
\raggedright%
\linespread{1.0}%
\inserttitle%
\par%
\vspace*{0.5em}
}
\setbeamertemplate{subtitle}{
\raggedright%
\insertsubtitle%
\par%
\vspace*{0.5em}
}
\newlength{\metropolis@titleseparator@linewidth}
\setlength{\metropolis@titleseparator@linewidth}{0.4pt}
\setbeamertemplate{title separator}{
\tikzexternaldisable%
\begin{tikzpicture}
\fill[fg] (0,0) rectangle (\textwidth, \metropolis@titleseparator@linewidth);
\end{tikzpicture}%
\tikzexternalenable%
\par%
}
\setbeamertemplate{author}{
\vspace*{2em}
\insertauthor%
\par%
\vspace*{0.25em}
}
\setbeamertemplate{date}{
\insertdate%
\par%
}
\setbeamertemplate{institute}{
\vspace*{3mm}
\insertinstitute%
\par%
}
\defbeamertemplate{section page}{simple}{
\begin{center}
\usebeamercolor[fg]{section title}
\usebeamerfont{section title}
\insertsectionhead\par
\ifx\insertsubsectionhead\@empty\else
\usebeamercolor[fg]{subsection title}
\usebeamerfont{subsection title}
\insertsubsectionhead
\fi
\end{center}
}
\defbeamertemplate{section page}{progressbar}{
\centering
\begin{minipage}{22em}
\raggedright
\usebeamercolor[fg]{section title}
\usebeamerfont{section title}
\insertsectionhead\\[-1ex]
\usebeamertemplate*{progress bar in section page}
\par
\ifx\insertsubsectionhead\@empty\else%
\usebeamercolor[fg]{subsection title}%
\usebeamerfont{subsection title}%
\insertsubsectionhead
\fi
\end{minipage}
\par
\vspace{\baselineskip}
}
\newcommand{\metropolis@disablesectionpage}{
\AtBeginSection{
% intentionally empty
}
}
\newcommand{\metropolis@enablesectionpage}{
\AtBeginSection{
\ifbeamer@inframe
\sectionpage
\else
\frame[plain,c,noframenumbering]{\sectionpage}
\fi
}
}
\setbeamertemplate{subsection page}{%
\usebeamertemplate*{section page}
}
\newcommand{\metropolis@disablesubsectionpage}{
\AtBeginSubsection{
% intentionally empty
}
}
\newcommand{\metropolis@enablesubsectionpage}{
\AtBeginSubsection{
\ifbeamer@inframe
\subsectionpage
\else
\frame[plain,c,noframenumbering]{\subsectionpage}
\fi
}
}
\newlength{\metropolis@progressonsectionpage}
\newlength{\metropolis@progressonsectionpage@linewidth}
\setlength{\metropolis@progressonsectionpage@linewidth}{0.4pt}
\setbeamertemplate{progress bar in section page}{
\setlength{\metropolis@progressonsectionpage}{%
\textwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
}%
\tikzexternaldisable%
\begin{tikzpicture}
\fill[bg] (0,0) rectangle (\textwidth, \metropolis@progressonsectionpage@linewidth);
\fill[fg] (0,0) rectangle (\metropolis@progressonsectionpage, \metropolis@progressonsectionpage@linewidth);
\end{tikzpicture}%
\tikzexternalenable%
}
\def\inserttotalframenumber{100}
\newlength{\metropolis@blocksep}
\newlength{\metropolis@blockadjust}
\setlength{\metropolis@blocksep}{0.75ex}
\setlength{\metropolis@blockadjust}{0.25ex}
\providecommand{\metropolis@strut}{%
\vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()}%
}
\newcommand{\metropolis@block}[1]{
\par\vskip\medskipamount%
\setlength{\parskip}{0pt}
\ifbeamercolorempty[bg]{block title#1}{%
\begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}}{%
\ifbeamercolorempty[bg]{block title}{%
\begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}%
}%
{%
\begin{beamercolorbox}[
sep=\dimexpr\metropolis@blocksep-\metropolis@blockadjust\relax,
leftskip=\metropolis@blockadjust,
rightskip=\dimexpr\metropolis@blockadjust plus 4em\relax
]{block title#1}%
}}%
\usebeamerfont*{block title#1}%
\metropolis@strut%
\insertblocktitle%
\metropolis@strut%
\end{beamercolorbox}%
\nointerlineskip%
\ifbeamercolorempty[bg]{block body#1}{%
\begin{beamercolorbox}[vmode]{block body#1}}{
\ifbeamercolorempty[bg]{block body}{%
\begin{beamercolorbox}[vmode]{block body#1}%
}{%
\begin{beamercolorbox}[sep=\metropolis@blocksep, vmode]{block body#1}%
\vspace{-\metropolis@parskip}
}}%
\usebeamerfont{block body#1}%
\setlength{\parskip}{\metropolis@parskip}%
}
\setbeamertemplate{block begin}{\metropolis@block{}}
\setbeamertemplate{block alerted begin}{\metropolis@block{ alerted}}
\setbeamertemplate{block example begin}{\metropolis@block{ example}}
\setbeamertemplate{block end}{\end{beamercolorbox}\vspace*{0.2ex}}
\setbeamertemplate{block alerted end}{\end{beamercolorbox}\vspace*{0.2ex}}
\setbeamertemplate{block example end}{\end{beamercolorbox}\vspace*{0.2ex}}
\setbeamertemplate{itemize items}{\textbullet}
\setbeamertemplate{caption label separator}{: }
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{footnote}{%
\parindent 0em\noindent%
\raggedright
\usebeamercolor{footnote}\hbox to 0.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
}
\newlength{\metropolis@parskip}
\setlength{\metropolis@parskip}{0.5em}
\setlength{\parskip}{\metropolis@parskip}
\linespread{1.15}
\define@key{beamerframe}{c}[true]{% centered
\beamer@frametopskip=0pt plus 1fill\relax%
\beamer@framebottomskip=0pt plus 1fill\relax%
\beamer@frametopskipautobreak=0pt plus .4\paperheight\relax%
\beamer@framebottomskipautobreak=0pt plus .6\paperheight\relax%
\def\beamer@initfirstlineunskip{}%
}
\providebool{metropolis@standout}
\define@key{beamerframe}{standout}[true]{%
\booltrue{metropolis@standout}
\begingroup
\setkeys{beamerframe}{c}
\setkeys{beamerframe}{noframenumbering}
\ifbeamercolorempty[bg]{palette primary}{
\setbeamercolor{background canvas}{
use=palette primary,
bg=-palette primary.fg
}
}{
\setbeamercolor{background canvas}{
use=palette primary,
bg=palette primary.bg
}
}
\setbeamercolor{local structure}{
fg=palette primary.fg
}
\usebeamercolor[fg]{palette primary}
}
\pretocmd{\beamer@reseteecodes}{%
\ifbool{metropolis@standout}{
\endgroup
\boolfalse{metropolis@standout}
}{}
}{}{}
\AtBeginEnvironment{beamer@frameslide}{
\ifbool{metropolis@standout}{
\centering
\usebeamerfont{standout}
}{}
}
\metropolis@inner@setdefaults
\ProcessPgfPackageOptions{/metropolis/inner}
\endinput
%%
%% End of file `beamerinnerthememetropolis.sty'.