Merge pull request #161 from benjamin-weiss/new-titleformat-commands

introduces new title format commands
This commit is contained in:
Matthias Vogelgesang 2015-12-04 15:38:06 +01:00
commit d9d839b325
6 changed files with 331 additions and 129 deletions

View File

@ -8,29 +8,30 @@
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot}
\usepackage{xspace}
\newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}
\title{Metropolis}
\subtitle{A modern beamer theme}
\date{\today}
\author{Matthias Vogelgesang}
\institute{Institute or miscellaneous information}
\institute{Center for modern beamer themes}
% \titlegraphic{\hfill\includegraphics[height=1.5cm]{logo/logo}}
\begin{document}
\maketitle
\begin{frame}
\frametitle{Table of Contents}
\begin{frame}{Table of contents}
\setbeamertemplate{section in toc}[sections numbered]
\tableofcontents[hideallsubsections]
\end{frame}
\section{Introduction}
\begin{frame}[fragile]
\frametitle{mtheme}
\begin{frame}[fragile]{Metropolis}
The \textsc{Metropolis} theme is a Beamer theme with minimal visual noise
The \themename theme is a Beamer theme with minimal visual noise
inspired by the \href{https://github.com/hsrmbeamertheme/hsrmbeamertheme}{\textsc{hsrm} Beamer
Theme} by Benjamin Weiss.
@ -42,19 +43,65 @@
Note, that you have to have Mozilla's \emph{Fira Sans} font and XeTeX
installed to enjoy this wonderful typography.
\end{frame}
\begin{frame}[fragile]
\frametitle{Sections}
\begin{frame}[fragile]{Sections}
Sections group slides of the same topic
\begin{verbatim} \section{Elements}\end{verbatim}
for which \textsc{Metropolis} provides a nice progress indicator \ldots
for which \themename provides a nice progress indicator \ldots
\end{frame}
\section{Titleformats}
\begin{frame}{Metropolis titleformats}
\themename supports 4 different titleformats:
\begin{itemize}
\item Regular
\item \textsc{Smallcaps}
\item \textsc{allsmallcaps}
\item ALLCAPS
\end{itemize}
They can either be set at once for every title type or individually.
\end{frame}
{
\metroset{titleformat frame=smallcaps}
\begin{frame}{Small caps}
This frame uses the \texttt{smallcaps} titleformat.
\begin{alertblock}{Potential Problems}
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 smallcaps will be typeset with the Computer Modern Serif font instead.
\end{alertblock}
\end{frame}
}
{
\metroset{titleformat frame=allsmallcaps}
\begin{frame}{All small caps}
This frame uses the \texttt{allsmallcaps} titleformat.
\begin{alertblock}{Potential problems}
As this titleformat also uses smallcaps you face the same problems as with the \texttt{smallcaps} titleformat. Additionally this format can cause some other problems. Please refer to the documentation if you consider using it.
As a rule of thumb: Just use it for plaintext-only titles.
\end{alertblock}
\end{frame}
}
{
\metroset{titleformat frame=allcaps}
\begin{frame}{All caps}
This frame uses the \texttt{allcaps} titleformat.
\begin{alertblock}{Potential Problems}
This titleformat 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.
\end{alertblock}
\end{frame}
}
\section{Elements}
\begin{frame}[fragile]
\frametitle{Typography}
\begin{frame}[fragile]{Typography}
\begin{verbatim}The theme provides sensible defaults to
\emph{emphasize} text, \alert{accent} parts
or show \textbf{bold} results.\end{verbatim}
@ -255,9 +302,7 @@ or show \textbf{bold} results.\end{verbatim}
\plain{Questions?}
\begin{frame}[allowframebreaks]
\frametitle{References}
\begin{frame}[allowframebreaks]{References}
\bibliography{demo}
\bibliographystyle{abbrv}

View File

@ -145,7 +145,7 @@
\newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace}
\GetFileInfo{beamerthememetropolis.dtx}
\title{Modern Beamer Presentations with the \themename{} package}
\title{Modern Beamer Presentations with the \themename package}
\author{Matthias Vogelgesang \\ \url{matthias.vogelgesang@gmail.com}}
\date{v0.x.x}
@ -162,17 +162,17 @@ now overused and can be a little cluttered, and the few distinctive custom
themes available are often specialized for a particular corporate or
institutional brand.
The goal of \themename{} is to provide a simple, modern Beamer theme suitable
The goal of \themename is to provide a simple, modern Beamer theme suitable
for anyone to use. It tries to minimize noise and maximize space for content;
the only visual flourish it offers is an (optional) progress bar added to each
slide or to the section slides.
By default, \themename{} uses
By default, \themename uses
\href{https://www.mozilla.org/en-US/styleguide/products/firefox-os/typeface/}
{Fira Sans}, a gorgeous typeface commissioned by Mozilla and designed by
\href{http://www.carrois.com/fira-3-1/}{Carrois}. For best results, you will
need the Fira typeface installed and use Xe\LaTeX{} to typeset your slides.
However, \themename{} can also be used with other typefaces and \LaTeX{} build
However, \themename can also be used with other typefaces and \LaTeX{} build
systems.
\themename's codebase is maintained on \href{https://github.com/matze/mtheme}
@ -185,9 +185,9 @@ the theme even better, please get in touch there. The
\section{Getting Started}
% \subsection{Installing from CTAN}
% For the regular user it is recommended to install \themename{} from
% For the regular user it is recommended to install \themename from
% \href{https://www.ctan.org}{CTAN}. In case you keep your \TeX\ distribution up-to-date,
% chances are good that \themename{} is already installed. If it is not, you need to update
% chances are good that \themename is already installed. If it is not, you need to update
% your packages. For \TeX\ Live (or Mac\TeX\ on OS X) the following command updates all
% packages.
@ -199,14 +199,14 @@ the theme even better, please get in touch there. The
% packages.
% To get the most out of the theme you should also install the |Fira| fonts. Yet this
% is not mandatory. \themename{} also works with the standard fonts.
% is not mandatory. \themename also works with the standard fonts.
\subsection{Installing from GitHub}
Installing \themename{}, like any Beamer theme, involves four easy steps:
Installing \themename, like any Beamer theme, involves four easy steps:
\begin{description}
\item[Download the source] with a |git clone| of the
\href{https://github.com/matze/mtheme}{\themename{} repository} or as a
\href{https://github.com/matze/mtheme}{\themename repository} or as a
\href{https://github.com/matze/mtheme/archive/master.zip}{zip archive}
of the latest development version.
@ -214,7 +214,7 @@ Installing \themename{}, like any Beamer theme, involves four easy steps:
directory. (Or run \LaTeX{} directly on |source/metropolistheme.ins|.)
\item[Move the resulting |*.sty| files] to the folder containing your
presentation. To use \themename{} with many presentations, run
presentation. To use \themename with many presentations, run
|make install| or move the |*.sty| files to a folder in your \TeX{} path
instead.
@ -222,14 +222,14 @@ Installing \themename{}, like any Beamer theme, involves four easy steps:
|\usetheme{metropolis}| in the preamble of your Beamer document.
\end{description}
\themename{} uses the Make build system to offer the following installation
\themename uses the Make build system to offer the following installation
options for advanced users:
\begin{description}
\item[|make sty|] builds the theme style files.
\item[|make doc|] builds this documentation manual.
\item[|make demo|] builds a demo presentation to test the features of
\themename{}.
\themename.
\item[|make all|] builds the theme, manual, and demo presentation.
\item[|make clean|] removes the files generated by |make all|.
\item[|make install|] installs the theme into your local texmf folder.
@ -244,7 +244,8 @@ containing the theme files as well as the Fira Sans font files.
\subsection{A Minimal Example}
The following code shows a minimal example of a Beamer presentation using \themename.
The following code shows a minimal example of a Beamer presentation using
\themename.
\begin{lstlisting}
\documentclass{beamer}
@ -266,15 +267,16 @@ The following code shows a minimal example of a Beamer presentation using \theme
\subsection{Dependencies}
\begin{itemize}
\item XeLaTeX
\item \href{https://github.com/mozilla/Fira}{Fira Sans} and Mono font
\item TikZ
\item XeLaTeX or LuaTeX
\item \href{https://github.com/mozilla/Fira}{Fira Sans} and Mono font
\end{itemize}
The |Fira Sans| font is not a hard dependency. \themename will try to load the
font and use it if it is installed, but if not it will just use the standard
font. Depending on the Linux distribution, the packaged name of |Fira Sans| might be
|Fira Sans OT| instead of |Fira Sans|. \themename will check for this name too.
font. Depending on the Linux distribution, the packaged name of |Fira Sans|
might be |Fira Sans OT| instead of |Fira Sans|. \themename will check for this
name too.
\subsection{Pandoc}
@ -318,12 +320,18 @@ is listed in multiple sub-packages, setting it on the main theme will set the
option on every sub-package accordingly.
\subsubsection{Main theme}
\DescribeOption{everytitleformat}{regular, lowercase, uppercase}{lowercase}{
Shortcut option to change the case style of all titles together.
\DescribeOption{titleformat}%
{regular, smallcaps, allsmallcaps, allcaps}
{regular}{
Shortcut option to change the titleformat of all titles together. Please
refer to section \ref{sec:titleformats} for known issues.
}
\DescribeOption{plaintitleformat}{regular, lowercase, uppercase}{lowercase}{
Control the case style of the plain title.
\DescribeOption{titleformat plain}%
{regular, smallcaps, allsmallcaps, allcaps}%
{regular}{
Control the titleformat of the plain title. Please refer to section
\ref{sec:titleformats} for known issues.
}
\subsubsection{Inner theme}
@ -337,12 +345,25 @@ option on every sub-package accordingly.
progress bar below the centered section title.
}
\DescribeOption{titleformat}{regular, lowercase, uppercase}{lowercase}{
Control the case style of the title.
\DescribeOption{titleformat title}%
{regular, smallcaps, allsmallcaps, allcaps}%
{regular}{
Control the titleformat of the title. Please refer to section
\ref{sec:titleformats} for known issues.
}
\DescribeOption{sectiontitleformat}{regular, lowercase, uppercase}{lowercase}{
Control the case style of the section title.
\DescribeOption{titleformat subtitle}%
{regular, smallcaps, allsmallcaps, allcaps}%
{regular}{
Control the titleformat of the subtitle. Please refer to section
\ref{sec:titleformats} for known issues.
}
\DescribeOption{titleformat section}%
{regular, smallcaps, allsmallcaps, allcaps}%
{regular}{
Control the titleformat of the section title. Please refer to section
\ref{sec:titleformats} for known issues.
}
\subsubsection{Outer theme}
@ -357,8 +378,11 @@ option on every sub-package accordingly.
frame (|foot|), or directly below each frame title (|frametitle|).
}
\DescribeOption{frametitleformat}{regular, lowercase, uppercase}{lowercase}{
Control the case style of the frame title.
\DescribeOption{titleformat frame}%
{regular, smallcaps, allsmallcaps, allcaps}%
{regular}{
Control the titleformat of the frame title. Please refer to section
\ref{sec:titleformats} for known issues.
}
\subsubsection{Color theme}
@ -400,10 +424,10 @@ of \themename specific colors, which can also be redefined to your liking.
\subsection{Font Customization}
The default font for \themename{} is |Fira|. Yet this can be easily changed
using the standard font selection commands of the \textsf{fontspec} package. So
if you for example prefer the \href{http://font.ubuntu.com}{|Ubuntu|} font
family just add the following two commands after loading the \themename{} theme.
The default font for \themename is |Fira|. Yet this can be easily changed using
the standard font selection commands of the \textsf{fontspec} package. So if
you for example prefer the \href{http://font.ubuntu.com}{|Ubuntu|} font family
just add the following two commands after loading the \themename theme.
\begin{lstlisting}
\setsansfont{Ubuntu}
@ -428,8 +452,11 @@ regular lined figures for math, you have to add the following to your preamble:
\subsection{Commands}
The \lstinline|\plain{title=[]}{<body>}| command sets a slide in plain dark colors which
can be useful to focus attention on a single sentence or image.
\begin{macro}{\plain}
The \lstinline|\plain{title=[]}{<body>}| command sets a slide in with a plain
dark background, which can be useful to focus attention on a single sentence
or image.
\end{macro}
\subsection{Paul Tol's colors: a \texttt{pgfplots} theme}
@ -452,8 +479,35 @@ or horizontal |mbarplot| to plot bar charts.
\section{Known Issues}
The \lstinline|\plain| command does not work if you override the \textsc{metropolis}
color theme with the default beamer color theme |fly|.
\subsection{Titleformats}
\label{sec:titleformats}
If you want to use either |smallcaps| or |allsmallcaps| be aware that not
every font supports small caps. So make sure the font you are using does.
|allsmallcaps| and |allcaps| are quite nice from an aesthetic point of view,
but they introduce some issues by using |\MakeLowercase| and |\MakeUppercase|,
respectively.
\begin{itemize}
\item Some commands, like |\\|, do not work inside |\MakeLowercase| and
|\MakeUppercase|. (See \href{https://github.com/matze/mtheme/issues/125}
{\#125})
\item Only alphabetic characters are affected by |\MakeLowercase|, so
numerals and punctuation remain at full height. This can spoil some of the
aesthetic benefits of |allsmallcaps|. (See
\href{https://github.com/matze/mtheme/issues/33}{\#33})
\item |\MakeLowercase| and |\MakeUppercase| apply to math mode and
|\scshape| does not. This can easily introduce mathematical errors that
are hard to catch.
\item It is impossible to typeset symbols which are encoded as uppercase
letters in a different font. In particular, |\mathbb| and |\mathcal|
letters will be replaced by other math glyphs. (See
\href{https://github.com/matze/mtheme/issues/153}{\#153})
\end{itemize}
\subsection{Plain Frame}
The |\plain| command does not work if you override the \themename color theme
with the default beamer color theme |fly|.
\section{License}

View File

@ -65,8 +65,8 @@
% \end{macro}
%
% \begin{macro}{\iffontexists}
% Resets the |fontsnotfound| counter and calls |\checkfont| for each font in the comma
% separated list in the first argument.
% Resets the |fontsnotfound| counter and calls |\checkfont| for each font in
% the comma separated list in the first argument.
% \begin{macrocode}
\newcommand{\iffontsexist}[3]{%
\setcounter{fontsnotfound}{0}%
@ -81,10 +81,10 @@
% \end{macrocode}
% \end{macro}
%
% Using the previously defined macros it is tried to load the |Fira| fonts. First the default
% |Fira| name will be tried. Second the |Fira| fonts with the suffix OT -- used by some Linux
% distributions -- will be tried. If this also fails a warning will be displayed and the
% standard fonts will be used.
% Using the previously defined macros it is tried to load the |Fira| fonts.
% First the default |Fira| name will be tried. Second the |Fira| fonts with
% the suffix OT -- used by some Linux distributions -- will be tried. If this
% also fails a warning will be displayed and the standard fonts will be used.
%
% \begin{macrocode}
\iffontsexist{Fira Sans Light,%
@ -100,7 +100,7 @@
\setsansfont[BoldFont={Fira Sans OT}]{Fira Sans Light OT}%
}{%
\PackageWarning{beamerthememetropolis}{%
Could not find Fira Sans fonts.%
Could not find Fira Sans fonts%
}
}
}
@ -111,7 +111,7 @@
\setmonofont{Fira Mono OT}%
}{%
\PackageWarning{beamerthememetropolis}{%
Could not find Fira Mono fonts.%
Could not find Fira Mono fonts%
}
}
}
@ -120,7 +120,7 @@
}
}{%
\PackageWarning{beamerthememetropolis}{%
You need to compile with XeLaTeX or LuaLaTeX to use the Fira fonts.%
You need to compile with XeLaTeX or LuaLaTeX to use the Fira fonts%
}
}
% \end{macrocode}
@ -131,22 +131,20 @@
%
% \begin{macrocode}
\setbeamerfont{title}{size=\Large,%
series=\bfseries,%
shape=\scshape}
series=\bfseries}
\setbeamerfont{author}{size=\small}
\setbeamerfont{date}{size=\small}
\setbeamerfont{section title}{size=\Large,%
series=\bfseries,%
shape=\scshape}
series=\bfseries}
\setbeamerfont{plain title}{size=\Large,%
series=\bfseries}
\setbeamerfont{block title}{size=\normalsize,%
series=\bfseries}
\setbeamerfont{block title alerted}{size=\normalsize,%
series=\bfseries}
\setbeamerfont*{subtitle}{size=\large,%
shape=\scshape}
\setbeamerfont*{subtitle}{size=\large}
\setbeamerfont{frametitle}{size=\large,%
series=\bfseries,%
shape=\scshape}
series=\bfseries}
\setbeamerfont{caption}{size=\small}
\setbeamerfont{caption name}{series=\bfseries}
\setbeamerfont{description item}{series=\bfseries}
@ -159,7 +157,6 @@
series=\normalfont}
\setbeamerfont{bibliography entry note}{size=\small,%
series=\normalfont}
\linespread{1.15}
% \end{macrocode}
%
% \iffalse

View File

@ -64,35 +64,97 @@
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{titleformat}
% Control the case style of the title
% \begin{macro}{titleformat title}
% Control the titleformat of the title
% \begin{macrocode}
\pgfkeys{
/metropolis/inner/titleformat/.cd,
/metropolis/inner/titleformat title/.cd,
.is choice,
regular/.code=\renewcommand{\@metropolis@titleformat}{},
lowercase/.code={%
\renewcommand{\@metropolis@titleformat}{\MakeLowercase}
regular/.code={%
\let\@metropolis@titleformat\@empty%
\setbeamerfont{title}{shape=\normalfont}%
},
uppercase/.code={%
\renewcommand{\@metropolis@titleformat}{\MakeUppercase}
smallcaps/.code={%
\let\@metropolis@titleformat\@empty%
\setbeamerfont{title}{shape=\scshape}%
},
allsmallcaps/.code={%
\let\@metropolis@titleformat\MakeLowercase%
\setbeamerfont{title}{shape=\scshape}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat title=allsmallcaps can lead to problems%
}
},
allcaps/.code={%
\let\@metropolis@titleformat\MakeUppercase%
\setbeamerfont{title}{shape=\normalfont}
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat title=allcaps can lead to problems%
}
},
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{sectiontitleformat}
% Control the case style of the section title
% \begin{macro}{titleformat subtitle}
% Control the titleformat of the subtitle
% \begin{macrocode}
\pgfkeys{
/metropolis/inner/sectiontitleformat/.cd,
/metropolis/inner/titleformat subtitle/.cd,
.is choice,
regular/.code=\renewcommand{\@metropolis@sectiontitleformat}{},
lowercase/.code={%
\renewcommand{\@metropolis@sectiontitleformat}{\MakeLowercase}
regular/.code={%
\let\@metropolis@subtitleformat\@empty%
\setbeamerfont{subtitle}{shape=\normalfont}%
},
uppercase/.code={%
\renewcommand{\@metropolis@sectiontitleformat}{\MakeUppercase}
smallcaps/.code={%
\let\@metropolis@subtitleformat\@empty%
\setbeamerfont{subtitle}{shape=\scshape}%
},
allsmallcaps/.code={%
\let\@metropolis@subtitleformat\MakeLowercase%
\setbeamerfont{subtitle}{shape=\scshape}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat subtitle=allsmallcaps can lead to problems%
}
},
allcaps/.code={%
\let\@metropolis@subtitleformat\MakeUppercase%
\setbeamerfont{subtitle}{shape=\normalfont}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat subtitle=allcaps can lead to problems%
}
},
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{titleformat section}
% Control the titleformat of the section title
% \begin{macrocode}
\pgfkeys{
/metropolis/inner/titleformat section/.cd,
.is choice,
regular/.code={%
\let\@metropolis@sectiontitleformat\@empty%
\setbeamerfont{section title}{shape=\normalfont}%
},
smallcaps/.code={%
\let\@metropolis@sectiontitleformat\@empty%
\setbeamerfont{section title}{shape=\scshape}%
},
allsmallcaps/.code={%
\let\@metropolis@sectiontitleformat\MakeLowercase%
\setbeamerfont{section title}{shape=\scshape}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat section=allsmallcaps can lead to problems%
}
},
allcaps/.code={%
\let\@metropolis@sectiontitleformat\MakeUppercase%
\setbeamerfont{section title}{shape=\normalfont}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat section=allcaps can lead to problems%
}
},
}
% \end{macrocode}
@ -118,8 +180,9 @@
\pgfkeys{/metropolis/inner/.cd,
sectionpage=progressbar,
block=transparent,
titleformat=lowercase,
sectiontitleformat=lowercase,
titleformat title=regular,
titleformat subtitle=regular,
titleformat section=regular,
}
}
% \end{macrocode}
@ -130,9 +193,10 @@
% \subsubsection{Title page}
%
% \begin{macro}{\@metropolis@titleformat}
% Define hooks to change the case format of the titles.
% Define hooks to change the case format of the titles.
% \begin{macrocode}
\def\@metropolis@titleformat#1{#1}
\def\@metropolis@subtitleformat#1{#1}
\def\@metropolis@sectiontitleformat#1{#1}
% \end{macrocode}
% \end{macro}
@ -148,18 +212,19 @@
{\def\insertsectionhead{#2}}
{\def\insertsectionhead{\@metropolis@sectiontitleformat{#2}}}
{}
{\PackageError{beamerinnerthememetropolis}{Patching section title failed.}}
{\PackageError{beamerinnerthememetropolis}{Patching section title failed}}
\patchcmd{\beamer@section}
{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{\@metropolis@sectiontitleformat{#1}}}}
{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{%
\@metropolis@sectiontitleformat{#1}}}}
{}
{\PackageError{beamerinnerthememetropolis}{Patching section title failed.}}
{\PackageError{beamerinnerthememetropolis}{Patching section title failed}}
% \end{macrocode}
%
% \begin{macro}{title page}
% Template for the title page. Each element is only typset if it is defined
% by the user. If |\subtitle| is empty, for example, it won't leave a blank
% space on the title slide.
% Template for the title page. Each element is only typset if it is defined
% by the user. If |\subtitle| is empty, for example, it won't leave a blank
% space on the title slide.
% \begin{macrocode}
\setbeamertemplate{title page}{
\begin{minipage}[b][\paperheight]{\textwidth}
@ -170,11 +235,11 @@
\usebeamertemplate*{title separator}
% \end{macrocode}
%
% Beamer's definition of |\insertauthor| is always nonempty, so we have
% to test another macro initialized by |\author{...}| to see if the user has
% defined an author. This solution was suggested by Enrico Gregorio in an
% answer to \href{https://tex.stackexchange.com/questions/241306/}{this
% Stack Exchange question}.
% Beamer's definition of |\insertauthor| is always nonempty, so we have
% to test another macro initialized by |\author{...}| to see if the user has
% defined an author. This solution was suggested by Enrico Gregorio in an
% answer to \href{https://tex.stackexchange.com/questions/241306/}{this
% Stack Exchange question}.
%
% \begin{macrocode}
\ifx\beamer@shortauthor\@empty\else\usebeamertemplate*{author}\fi
@ -244,7 +309,7 @@
% Set the subtitle on the title page.
% \begin{macrocode}
\setbeamertemplate{subtitle}{
\insertsubtitle%
\@metropolis@subtitleformat{\insertsubtitle}%
\par%
\vspace*{0.5em}
}

View File

@ -68,41 +68,63 @@
\setbeamertemplate{footline}[plain]
},
head/.code={\pgfkeys{/metropolis/outer/progressbar=none}
\addtobeamertemplate{headline}{}{\usebeamertemplate*{progress bar in head/foot}}
\addtobeamertemplate{headline}{}{%
\usebeamertemplate*{progress bar in head/foot}
}
},
frametitle/.code={\pgfkeys{/metropolis/outer/progressbar=none}
\addtobeamertemplate{frametitle}{}{\usebeamertemplate*{progress bar in head/foot}}
\addtobeamertemplate{frametitle}{}{%
\usebeamertemplate*{progress bar in head/foot}
}
},
foot/.code={\pgfkeys{/metropolis/outer/progressbar=none}
\addtobeamertemplate{footline}{}{\usebeamertemplate*{progress bar in head/foot}}
\addtobeamertemplate{footline}{}{%
\usebeamertemplate*{progress bar in head/foot}%
}
},
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{frametitleformat}
% Control the case style of the frame title
% Control the titleformat of the frame title
% \begin{macrocode}
\pgfkeys{
/metropolis/outer/frametitleformat/.cd,
/metropolis/outer/titleformat frame/.cd,
.is choice,
regular/.code={%
\renewcommand{\@metropolis@frametitleformat}{}%
\let\@metropolis@frametitleformat\@empty%
\setbeamerfont{frametitle}{shape=\normalfont}%
\renewcommand{\@metropolis@frametitlestrut}{%
\vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}%
}
},
lowercase/.code={%
\renewcommand{\@metropolis@frametitleformat}{\MakeLowercase}%
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%
}
},
uppercase/.code={%
\renewcommand{\@metropolis@frametitleformat}{\MakeUppercase}%
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}
@ -115,7 +137,7 @@
\pgfkeys{/metropolis/outer/.cd,
numbering=counter,
progressbar=none,
frametitleformat=lowercase,
titleformat frame=regular,
}
}
% \end{macrocode}%
@ -174,17 +196,20 @@
% \begin{macrocode}
\patchcmd{\beamer@@frametitle}
{\beamer@ifempty{#2}{}{%
\gdef\insertframetitle{{#2\ifnum\beamer@autobreakcount>0\relax{}\space\usebeamertemplate*{frametitle continuation}\fi}}%
\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\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.}}
{\PackageError{beamerouterthememetropolis}{Patching frame title failed}}
% \end{macrocode}
%
% \begin{macro}{frametitle}

View File

@ -69,32 +69,48 @@
}
% \end{macrocode}
%
% \begin{macro}{plaintitleformat}
% Control the case style of the plain title
% \begin{macro}{titleformat plain}
% Control the titleformat of the plain title
% \begin{macrocode}
\pgfkeys{
/metropolis/plaintitleformat/.cd,
/metropolis/titleformat plain/.cd,
.is choice,
regular/.code=\renewcommand{\@metropolis@plaintitleformat}{#1},
lowercase/.code={%
\renewcommand{\@metropolis@plaintitleformat}{\MakeLowercase{#1}}
regular/.code={%
\let\@metropolis@plaintitleformat\@empty%
\setbeamerfont{plain title}{shape=\normalfont}%
},
uppercase/.code={%
\renewcommand{\@metropolis@plaintitleformat}{\MakeUppercase{#1}}
smallcaps/.code={%
\let\@metropolis@plaintitleformat\@empty%
\setbeamerfont{plain title}{shape=\scshape}%
},
allsmallcaps/.code={%
\let\@metropolis@plaintitleformat\MakeLowercase%
\setbeamerfont{plain title}{shape=\scshape}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat plain=allsmallcaps can lead to problems%
}
},
allcaps/.code={%
\let\@metropolis@plaintitleformat\MakeUppercase%
\setbeamerfont{plain title}{shape=\normalfont}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat plain=allcaps can lead to problems%
}
},
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{everytitleformat}
% Control the case style of the every title
% \begin{macro}{titleformat}
% Control the titleformat of every title type together
% \begin{macrocode}
\pgfkeys{
/metropolis/everytitleformat/.code=\pgfkeysalso{
inner/titleformat=#1,
inner/sectiontitleformat=#1,
outer/frametitleformat=#1,
plaintitleformat=#1,
/metropolis/titleformat/.code=\pgfkeysalso{
inner/titleformat title=#1,
inner/titleformat subtitle=#1,
inner/titleformat section=#1,
outer/titleformat frame=#1,
titleformat plain=#1,
}
}
% \end{macrocode}
@ -119,7 +135,7 @@
% \begin{macrocode}
\newcommand{\@metropolis@setdefaults}{
\pgfkeys{/metropolis/.cd,
plaintitleformat=lowercase,
titleformat plain=regular,
}
}
% \end{macrocode}
@ -174,7 +190,7 @@
\begin{frame}[c]{#1}
\begin{center}
\usebeamercolor[fg]{palette primary}
\usebeamerfont{section title}
\usebeamerfont{plain title}
\@metropolis@plaintitleformat{#2}
\end{center}
\end{frame}