Merge pull request #189 from rchurchley/standout-slides

Use frame key for standout slides, move to inner theme
This commit is contained in:
Matthias Vogelgesang 2016-03-09 10:18:56 +01:00
commit 820589f497
5 changed files with 84 additions and 34 deletions

View File

@ -309,7 +309,9 @@ or show \textbf{bold} results.\end{verbatim}
\end{frame}
\plain{Questions?}
\begin{frame}[standout]
Questions?
\end{frame}
\appendix

View File

@ -453,11 +453,18 @@ regular lined figures for math, you could add the following to your preamble:
\subsection{Commands}
\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}
\subsubsection{Standout frames}
The \themename inner theme offers a custom frame format with large, centered
text and an inverted background --- perfect for focusing attention on
single sentence or image. To use it, add the key |standout| to the frame:
\begin{lstlisting}
\begin{frame}[standout]
Thank you!
\end{frame}
\end{lstlisting}
\section{\texttt{pgfplots} integration}
@ -551,8 +558,7 @@ only alphabetic characters and do not require the expansion of any macros.
\themename can be used along with any other Beamer color theme, such as
|crane| or |seahorse|. If you wish to do this, it is usually best to include
the \themename subpackages individually so the \themename color theme is
never loaded. Although this will disable some features, including
|\plain| slides, it will prevent conflicts between the \themename color theme
never loaded. This will prevent conflicts between the \themename color theme
and your preferred theme.
For example, overriding the color theme as follows may not work as expected because |\usetheme{metropolis}| loads the \themename color theme, which

View File

@ -155,8 +155,6 @@
\setbeamerfont{date}{size=\small}
\setbeamerfont{section title}{size=\Large,%
series=\bfseries}
\setbeamerfont{plain title}{size=\Large,%
series=\bfseries}
\setbeamerfont{block title}{size=\normalsize,%
series=\bfseries}
\setbeamerfont{block title alerted}{size=\normalsize,%
@ -176,6 +174,8 @@
series=\normalfont}
\setbeamerfont{bibliography entry note}{size=\small,%
series=\normalfont}
\setbeamerfont{standout}{size=\Large,%
series=\bfseries}
% \end{macrocode}
%
%

View File

@ -46,6 +46,7 @@
%
% \begin{macrocode}
\RequirePackage{etoolbox}
\RequirePackage{keyval}
\RequirePackage{calc}
\RequirePackage{pgfopts}
\RequirePackage{tikz}
@ -474,6 +475,60 @@
%
%
%
% \subsubsection{Standout frames}
%
% \themename offers a custom frame format with large, centered text and an
% inverted background. To use it, add the key |standout| to the frame:
% |\begin{frame}[standout] ... \end{frame}|.
%
% \begin{macro}{standout}
%
% Optional arguments to Beamer's frames are implemented using
% |\define@key| from the |keyval| package, which will execute code when the
% defined option is called. For the |standout| option, we begin a group,
% change the colors and fonts, and set a \centering alignment.
%
% \begin{macrocode}
\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
}
}
\centering
\usebeamercolor[fg]{palette primary}
\usebeamerfont{standout}
}
% \end{macrocode}
%
% Then we just have to close the group after the standout slide is finished
% in order to restore the colours and fonts for the rest of the
% presentation. Unfortunately, we cannot use \AfterEndEnvironment{frame} for
% this (see \url{http://tex.stackexchange.com/questions/226319/}).
% Instead, we add the |\endgroup| to |\beamer@reseteecodes|, which is run
% exactly once at the end of each slide.
%
% \begin{macrocode}
\apptocmd{\beamer@reseteecodes}{%
\ifbool{metropolis@standout}{
\endgroup
\boolfalse{metropolis@standout}
}{}
}{}{}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{Process package options}
%
% \begin{macrocode}

View File

@ -68,22 +68,22 @@
.is choice,
regular/.code={%
\let\metropolis@plaintitleformat\@empty%
\setbeamerfont{plain title}{shape=\normalfont}%
\setbeamerfont{standout}{shape=\normalfont}%
},
smallcaps/.code={%
\let\metropolis@plaintitleformat\@empty%
\setbeamerfont{plain title}{shape=\scshape}%
\setbeamerfont{standout}{shape=\scshape}%
},
allsmallcaps/.code={%
\let\metropolis@plaintitleformat\MakeLowercase%
\setbeamerfont{plain title}{shape=\scshape}%
\setbeamerfont{standout}{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}%
\setbeamerfont{standout}{shape=\normalfont}%
\PackageWarning{beamerthememetropolis}{%
Be aware that titleformat plain=allcaps can lead to problems%
}
@ -177,26 +177,13 @@
% \begin{macrocode}
\def\metropolis@plaintitleformat#1{#1}
\newcommand{\plain}[2][]{%
\begingroup
\ifbeamercolorempty[bg]{palette primary}{
\setbeamercolor{background canvas}{
use=palette primary,
bg=-palette primary.fg
}
}{
\setbeamercolor{background canvas}{
use=palette primary,
bg=palette primary.bg
}
}
\begin{frame}[c,noframenumbering]{#1}
\begin{center}
\usebeamercolor[fg]{palette primary}
\usebeamerfont{plain title}
\metropolis@plaintitleformat{#2}
\end{center}
\end{frame}
\endgroup
\PackageWarning{beamerthememetropolis}{%
The syntax `\plain' may be deprecated in a future version of Metropolis.
Please use a frame with [standout] instead.
}
\begin{frame}[standout]{#1}
\metropolis@plaintitleformat{#2}
\end{frame}
}
% \end{macrocode}
% \end{macro}