Merge pull request #177 from rchurchley/color-compatibility
Improve compatibility with other color themes
This commit is contained in:
commit
ed11f5fc37
|
@ -357,10 +357,6 @@ The list of options is structured as shown in the following example.
|
||||||
|
|
||||||
|
|
||||||
\subsubsection{Inner theme}
|
\subsubsection{Inner theme}
|
||||||
\DescribeOption{block}{transparent, fill}{transparent}{
|
|
||||||
Optionally adds a light grey background to block environments like |theorem|
|
|
||||||
and |example|.
|
|
||||||
}
|
|
||||||
|
|
||||||
\DescribeOption{sectionpage}{none, simple, progressbar}{progressbar}{
|
\DescribeOption{sectionpage}{none, simple, progressbar}{progressbar}{
|
||||||
Adds a slide at the start of each section (|simple|) with an optional thin
|
Adds a slide at the start of each section (|simple|) with an optional thin
|
||||||
|
@ -416,6 +412,7 @@ terms of three beamer colors:
|
||||||
\item |alerted text| (colored fg, should be visible against dark or light)
|
\item |alerted text| (colored fg, should be visible against dark or light)
|
||||||
\item |example text| (colored fg, should be visible against dark or light)
|
\item |example text| (colored fg, should be visible against dark or light)
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
An easy way to customize the theme is to redefine these colors using
|
An easy way to customize the theme is to redefine these colors using
|
||||||
|
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
|
@ -526,10 +523,40 @@ only alphabetic characters and do not require the expansion of any macros.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\subsection{Plain Frame}
|
\subsection{Interactions with other color themes}
|
||||||
The |\plain| command does not work if you override the \themename color theme
|
|
||||||
with the default beamer color theme |fly|.
|
|
||||||
|
|
||||||
|
\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
|
||||||
|
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
|
||||||
|
defines a relationship between the frametitle background and the primary
|
||||||
|
palette of the theme. Since |seahorse| assumes a different relationship
|
||||||
|
between its palettes, the result is a grey, rather than periwinkle,
|
||||||
|
frametitle background.
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
\usetheme{metropolis}
|
||||||
|
\usecolortheme{seahorse}
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
The correct colors are chosen if the \themename outer, inner, and font themes
|
||||||
|
are loaded seperately:
|
||||||
|
|
||||||
|
\begin{lstlisting}
|
||||||
|
\useoutertheme{metropolis}
|
||||||
|
\useinnertheme{metropolis}
|
||||||
|
\usefonttheme{metropolis}
|
||||||
|
\usecolortheme{seahorse} % or your preferred color theme
|
||||||
|
\end{lstlisting}
|
||||||
|
|
||||||
|
Please note that \themename may not use all the colors defined in your
|
||||||
|
favourite Beamer color theme. In particular, \themename does not set a
|
||||||
|
background color for the title; this will cause issues when using color themes
|
||||||
|
like |whale| which set a white foreground for the title.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
%<driver> \ProvidesFile{beamercolorthememetropolis.dtx}
|
%<driver> \ProvidesFile{beamercolorthememetropolis.dtx}
|
||||||
%<*package>
|
%<*package>
|
||||||
\NeedsTeXFormat{LaTeX2e}
|
\NeedsTeXFormat{LaTeX2e}
|
||||||
\ProvidesPackage{beamercolorthememetropolis}[2016/02/06 Metropolis color theme]
|
\ProvidesPackage{beamercolorthememetropolis}[2016/02/21 Metropolis color theme]
|
||||||
%</package>
|
%</package>
|
||||||
%<driver> \documentclass{ltxdoc}
|
%<driver> \documentclass{ltxdoc}
|
||||||
%<driver> \usepackage{beamercolorthememetropolis}
|
%<driver> \usepackage{beamercolorthememetropolis}
|
||||||
|
@ -41,7 +41,8 @@
|
||||||
% \subsubsection{Options}
|
% \subsubsection{Options}
|
||||||
%
|
%
|
||||||
% \begin{macro}{block}
|
% \begin{macro}{block}
|
||||||
% Controls whether block environments are filled or transparent.
|
% Optionally adds a light grey background to block environments like
|
||||||
|
% |theorem| and |example|.
|
||||||
% \begin{macrocode}
|
% \begin{macrocode}
|
||||||
\pgfkeys{
|
\pgfkeys{
|
||||||
/metropolis/color/block/.cd,
|
/metropolis/color/block/.cd,
|
||||||
|
@ -176,11 +177,22 @@
|
||||||
}
|
}
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
%
|
%
|
||||||
% Blocks
|
% Block environments such as |theorem| and |example| have no background color
|
||||||
|
% by default. The option |block=fill| sets a background color based on the
|
||||||
|
% background and foreground of |normal text|. The option |block=transparent|
|
||||||
|
% reverts the block environments to an empty background, which can be useful
|
||||||
|
% if changing colors mid-presentation.
|
||||||
%
|
%
|
||||||
% \begin{macrocode}
|
% \begin{macrocode}
|
||||||
\newcommand{\metropolis@block@transparent}{
|
\newcommand{\metropolis@block@transparent}{
|
||||||
\setbeamercolor{block title}{use=normal text, parent=normal text}
|
\setbeamercolor{block title}{%
|
||||||
|
use=normal text,
|
||||||
|
fg=normal text.fg,
|
||||||
|
bg=
|
||||||
|
}
|
||||||
|
\setbeamercolor{block body}{
|
||||||
|
bg=
|
||||||
|
}
|
||||||
}
|
}
|
||||||
\newcommand{\metropolis@block@fill}{
|
\newcommand{\metropolis@block@fill}{
|
||||||
\setbeamercolor{block title}{%
|
\setbeamercolor{block title}{%
|
||||||
|
@ -188,6 +200,10 @@
|
||||||
fg=normal text.fg,
|
fg=normal text.fg,
|
||||||
bg=normal text.bg!80!fg
|
bg=normal text.bg!80!fg
|
||||||
}
|
}
|
||||||
|
\setbeamercolor{block body}{
|
||||||
|
use={block title, normal text},
|
||||||
|
bg=block title.bg!50!normal text.bg
|
||||||
|
}
|
||||||
}
|
}
|
||||||
\setbeamercolor{block title alerted}{%
|
\setbeamercolor{block title alerted}{%
|
||||||
use={block title, alerted text},
|
use={block title, alerted text},
|
||||||
|
@ -201,10 +217,6 @@
|
||||||
}
|
}
|
||||||
\setbeamercolor{block body alerted}{use=block body, parent=block body}
|
\setbeamercolor{block body alerted}{use=block body, parent=block body}
|
||||||
\setbeamercolor{block body example}{use=block body, parent=block body}
|
\setbeamercolor{block body example}{use=block body, parent=block body}
|
||||||
\setbeamercolor{block body}{
|
|
||||||
use={block title, normal text},
|
|
||||||
bg=block title.bg!50!normal text.bg
|
|
||||||
}
|
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
%
|
%
|
||||||
% Footnotes
|
% Footnotes
|
||||||
|
@ -214,7 +226,9 @@
|
||||||
\setbeamercolor{footnote mark}{fg=.}
|
\setbeamercolor{footnote mark}{fg=.}
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
%
|
%
|
||||||
% Process package options
|
%
|
||||||
|
%
|
||||||
|
% \subsubsection{Process package options}
|
||||||
%
|
%
|
||||||
% \begin{macrocode}
|
% \begin{macrocode}
|
||||||
\metropolis@color@setdefaults
|
\metropolis@color@setdefaults
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
%<driver> \ProvidesFile{beamerfontthememetropolis.dtx}
|
%<driver> \ProvidesFile{beamerfontthememetropolis.dtx}
|
||||||
%<*package>
|
%<*package>
|
||||||
\NeedsTeXFormat{LaTeX2e}
|
\NeedsTeXFormat{LaTeX2e}
|
||||||
\ProvidesPackage{beamerfontthememetropolis}[2016/02/06 Metropolis font theme]
|
\ProvidesPackage{beamerfontthememetropolis}[2016/02/21 Metropolis font theme]
|
||||||
%</package>
|
%</package>
|
||||||
%<driver> \documentclass{ltxdoc}
|
%<driver> \documentclass{ltxdoc}
|
||||||
%<driver> \usepackage{beamerfontthememetropolis}
|
%<driver> \usepackage{beamerfontthememetropolis}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
%<driver> \ProvidesFile{beamerinnerthememetropolis.dtx}
|
%<driver> \ProvidesFile{beamerinnerthememetropolis.dtx}
|
||||||
%<*package>
|
%<*package>
|
||||||
\NeedsTeXFormat{LaTeX2e}
|
\NeedsTeXFormat{LaTeX2e}
|
||||||
\ProvidesPackage{beamerinnerthememetropolis}[2016/02/06 Metropolis inner theme]
|
\ProvidesPackage{beamerinnerthememetropolis}[2016/02/21 Metropolis inner theme]
|
||||||
%</package>
|
%</package>
|
||||||
%<driver> \documentclass{ltxdoc}
|
%<driver> \documentclass{ltxdoc}
|
||||||
%<driver> \usepackage{beamerinnerthememetropolis}
|
%<driver> \usepackage{beamerinnerthememetropolis}
|
||||||
|
@ -55,18 +55,6 @@
|
||||||
%
|
%
|
||||||
% \subsubsection{Options}
|
% \subsubsection{Options}
|
||||||
%
|
%
|
||||||
% \begin{macro}{block}
|
|
||||||
% This option controls the block style.
|
|
||||||
% \begin{macrocode}
|
|
||||||
\pgfkeys{
|
|
||||||
/metropolis/inner/block/.cd,
|
|
||||||
.is choice,
|
|
||||||
transparent/.code=\setlength{\metropolis@blockskip}{0ex},
|
|
||||||
fill/.code=\setlength{\metropolis@blockskip}{1ex},
|
|
||||||
}
|
|
||||||
% \end{macrocode}
|
|
||||||
% \end{macro}
|
|
||||||
%
|
|
||||||
% \begin{macro}{sectionpage}
|
% \begin{macro}{sectionpage}
|
||||||
% The |sectionpage| option defines the behaviour of the sectionpage.
|
% The |sectionpage| option defines the behaviour of the sectionpage.
|
||||||
% \begin{macrocode}
|
% \begin{macrocode}
|
||||||
|
@ -86,7 +74,6 @@
|
||||||
\newcommand{\metropolis@inner@setdefaults}{
|
\newcommand{\metropolis@inner@setdefaults}{
|
||||||
\pgfkeys{/metropolis/inner/.cd,
|
\pgfkeys{/metropolis/inner/.cd,
|
||||||
sectionpage=progressbar,
|
sectionpage=progressbar,
|
||||||
block=transparent,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
|
@ -328,87 +315,70 @@
|
||||||
%
|
%
|
||||||
% \subsubsection{Block environments}
|
% \subsubsection{Block environments}
|
||||||
%
|
%
|
||||||
% Regular block environment
|
%
|
||||||
|
% \begin{macro}{block}
|
||||||
|
% \begin{macro}{block alerted}
|
||||||
|
% \begin{macro}{block example}
|
||||||
|
%
|
||||||
|
% The three different block environments differ only in their colours.
|
||||||
|
% Rather than repeat the essentially the same template three times, we use
|
||||||
|
% the auxiliary macro |\metropolis@block| to define all three templates.
|
||||||
%
|
%
|
||||||
% \begin{macrocode}
|
% \begin{macrocode}
|
||||||
\newlength{\metropolis@blockskip}
|
\newlength{\metropolis@blocktitleskip}
|
||||||
\setbeamertemplate{block begin}{%
|
\newlength{\metropolis@blockbodyskip}
|
||||||
|
\newcommand{\metropolis@block}[1]{
|
||||||
\setlength{\parskip}{\metropolis@parskip}
|
\setlength{\parskip}{\metropolis@parskip}
|
||||||
|
% \end{macrocode}
|
||||||
|
%
|
||||||
|
% If a background color is defined for the block title or body, a little
|
||||||
|
% bit of padding is added to the corresponding box.
|
||||||
|
%
|
||||||
|
% \begin{macrocode}
|
||||||
|
\ifbeamercolorempty[bg]{block title}
|
||||||
|
{\setlength{\metropolis@blocktitleskip}{0ex}}
|
||||||
|
{\setlength{\metropolis@blocktitleskip}{1ex}}
|
||||||
|
\ifbeamercolorempty[bg]{block body}
|
||||||
|
{\setlength{\metropolis@blockbodyskip}{0ex}}
|
||||||
|
{\setlength{\metropolis@blockbodyskip}{1ex}}
|
||||||
\vspace*{1ex}
|
\vspace*{1ex}
|
||||||
|
% \end{macrocode}
|
||||||
|
%
|
||||||
|
% Each block environment consists of two (possibly coloured) beamer boxes:
|
||||||
|
% one for the title and one for the body.
|
||||||
|
%
|
||||||
|
% \begin{macrocode}
|
||||||
\begin{beamercolorbox}[%
|
\begin{beamercolorbox}[%
|
||||||
ht=2.4ex,
|
ht=2.4ex,
|
||||||
dp=1ex,
|
dp=1ex,
|
||||||
leftskip=\metropolis@blockskip,
|
leftskip=\metropolis@blocktitleskip,
|
||||||
rightskip=\metropolis@blockskip]{block title}
|
rightskip=\metropolis@blocktitleskip]{block title#1}
|
||||||
\usebeamerfont*{block title}\insertblocktitle%
|
\usebeamerfont*{block title#1}\insertblocktitle%
|
||||||
\end{beamercolorbox}%
|
\end{beamercolorbox}%
|
||||||
\vspace*{-1pt}
|
\nointerlineskip%
|
||||||
\usebeamerfont{block body}%
|
\usebeamerfont{block body#1}%
|
||||||
\begin{beamercolorbox}[%
|
\begin{beamercolorbox}[%
|
||||||
dp=1ex,
|
dp=1ex,
|
||||||
leftskip=\metropolis@blockskip,
|
leftskip=\metropolis@blockbodyskip,
|
||||||
rightskip=\metropolis@blockskip,
|
rightskip=\metropolis@blockbodyskip,
|
||||||
vmode]{block body}%
|
vmode]{block body#1}%
|
||||||
}
|
|
||||||
\setbeamertemplate{block end}{%
|
|
||||||
\end{beamercolorbox}
|
|
||||||
\vspace*{0.2ex}
|
|
||||||
}
|
}
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
%
|
%
|
||||||
% Alerted block environment
|
% This concludes the auxiliary macro |\metropolis@block|. Next,
|
||||||
|
% we define the block beamer templates using this macro.
|
||||||
%
|
%
|
||||||
% \begin{macrocode}
|
% \begin{macrocode}
|
||||||
\setbeamertemplate{block alerted begin}{%
|
\setbeamertemplate{block begin}{\metropolis@block{}}
|
||||||
\setlength{\parskip}{\metropolis@parskip}
|
\setbeamertemplate{block alerted begin}{\metropolis@block{ alerted}}
|
||||||
\vspace*{1ex}
|
\setbeamertemplate{block example begin}{\metropolis@block{ example}}
|
||||||
\begin{beamercolorbox}[%
|
\setbeamertemplate{block end}{\end{beamercolorbox}\vspace*{0.2ex}}
|
||||||
ht=2.4ex,
|
\setbeamertemplate{block alerted end}{\end{beamercolorbox}\vspace*{0.2ex}}
|
||||||
dp=1ex,
|
\setbeamertemplate{block example end}{\end{beamercolorbox}\vspace*{0.2ex}}
|
||||||
leftskip=\metropolis@blockskip,
|
|
||||||
rightskip=\metropolis@blockskip]{block title alerted}
|
|
||||||
\usebeamerfont*{block title alerted}\insertblocktitle%
|
|
||||||
\end{beamercolorbox}%
|
|
||||||
\vspace*{-1pt}
|
|
||||||
\usebeamerfont{block body alerted}%
|
|
||||||
\begin{beamercolorbox}[%
|
|
||||||
dp=1ex,
|
|
||||||
leftskip=\metropolis@blockskip,
|
|
||||||
rightskip=\metropolis@blockskip,
|
|
||||||
vmode]{block body alerted}%
|
|
||||||
}
|
|
||||||
\setbeamertemplate{block alerted end}{%
|
|
||||||
\end{beamercolorbox}
|
|
||||||
\vspace*{0.2ex}
|
|
||||||
}
|
|
||||||
% \end{macrocode}
|
|
||||||
%
|
|
||||||
% Example block environment
|
|
||||||
%
|
|
||||||
% \begin{macrocode}
|
|
||||||
\setbeamertemplate{block example begin}{%
|
|
||||||
\setlength{\parskip}{\metropolis@parskip}
|
|
||||||
\vspace*{1ex}
|
|
||||||
\begin{beamercolorbox}[%
|
|
||||||
ht=2.4ex,
|
|
||||||
dp=1ex,
|
|
||||||
leftskip=\metropolis@blockskip,
|
|
||||||
rightskip=\metropolis@blockskip]{block title example}
|
|
||||||
\usebeamerfont*{block title example}\insertblocktitle%
|
|
||||||
\end{beamercolorbox}%
|
|
||||||
\vspace*{-1pt}
|
|
||||||
\usebeamerfont{block body example}%
|
|
||||||
\begin{beamercolorbox}[%
|
|
||||||
dp=1ex,
|
|
||||||
leftskip=\metropolis@blockskip,
|
|
||||||
rightskip=\metropolis@blockskip,
|
|
||||||
vmode]{block body example}%
|
|
||||||
}
|
|
||||||
\setbeamertemplate{block example end}{%
|
|
||||||
\end{beamercolorbox}
|
|
||||||
\vspace*{0.2ex}
|
|
||||||
}
|
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
|
% \end{macro}
|
||||||
|
% \end{macro}
|
||||||
|
% \end{macro}
|
||||||
%
|
%
|
||||||
%
|
%
|
||||||
%
|
%
|
||||||
|
@ -459,7 +429,9 @@
|
||||||
}
|
}
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
%
|
%
|
||||||
% Process package options
|
%
|
||||||
|
%
|
||||||
|
% \subsubsection{Process package options}
|
||||||
%
|
%
|
||||||
% \begin{macrocode}
|
% \begin{macrocode}
|
||||||
\metropolis@inner@setdefaults
|
\metropolis@inner@setdefaults
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
%<driver> \ProvidesFile{beamerouterthememetropolis.dtx}
|
%<driver> \ProvidesFile{beamerouterthememetropolis.dtx}
|
||||||
%<*package>
|
%<*package>
|
||||||
\NeedsTeXFormat{LaTeX2e}
|
\NeedsTeXFormat{LaTeX2e}
|
||||||
\ProvidesPackage{beamerouterthememetropolis}[2016/02/06 Metropolis outer theme]
|
\ProvidesPackage{beamerouterthememetropolis}[2016/02/21 Metropolis outer theme]
|
||||||
%</package>
|
%</package>
|
||||||
%<driver> \documentclass{ltxdoc}
|
%<driver> \documentclass{ltxdoc}
|
||||||
%<driver> \usepackage{beamerouterthememetropolis}
|
%<driver> \usepackage{beamerouterthememetropolis}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
%<driver> \ProvidesFile{beamerthememetropolis.dtx}
|
%<driver> \ProvidesFile{beamerthememetropolis.dtx}
|
||||||
%<*package>
|
%<*package>
|
||||||
\NeedsTeXFormat{LaTeX2e}
|
\NeedsTeXFormat{LaTeX2e}
|
||||||
\ProvidesPackage{beamerthememetropolis}[2016/02/06 Metropolis Beamer theme]
|
\ProvidesPackage{beamerthememetropolis}[2016/02/21 Metropolis Beamer theme]
|
||||||
%</package>
|
%</package>
|
||||||
%<driver> \documentclass{ltxdoc}
|
%<driver> \documentclass{ltxdoc}
|
||||||
%<driver> \usepackage{beamerthememetropolis}
|
%<driver> \usepackage{beamerthememetropolis}
|
||||||
|
@ -55,17 +55,7 @@
|
||||||
/metropolis/outer,
|
/metropolis/outer,
|
||||||
/metropolis/color,
|
/metropolis/color,
|
||||||
/metropolis/font,
|
/metropolis/font,
|
||||||
},
|
}
|
||||||
% \end{macrocode}
|
|
||||||
%
|
|
||||||
% Currently, the |block| option affects two subthemes and has to be handled
|
|
||||||
% separately.
|
|
||||||
%
|
|
||||||
% \begin{macrocode}
|
|
||||||
block/.code=\pgfkeysalso{
|
|
||||||
inner/block=#1,
|
|
||||||
color/block=#1,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
% \end{macrocode}
|
% \end{macrocode}
|
||||||
%
|
%
|
||||||
|
@ -187,9 +177,16 @@
|
||||||
\def\metropolis@plaintitleformat#1{#1}
|
\def\metropolis@plaintitleformat#1{#1}
|
||||||
\newcommand{\plain}[2][]{%
|
\newcommand{\plain}[2][]{%
|
||||||
\begingroup
|
\begingroup
|
||||||
\setbeamercolor{background canvas}{
|
\ifbeamercolorempty[bg]{palette primary}{
|
||||||
use=palette primary,
|
\setbeamercolor{background canvas}{
|
||||||
parent=palette primary
|
use=palette primary,
|
||||||
|
bg=-palette primary.fg
|
||||||
|
}
|
||||||
|
}{
|
||||||
|
\setbeamercolor{background canvas}{
|
||||||
|
use=palette primary,
|
||||||
|
bg=palette primary.bg
|
||||||
|
}
|
||||||
}
|
}
|
||||||
\begin{frame}[c]{#1}
|
\begin{frame}[c]{#1}
|
||||||
\begin{center}
|
\begin{center}
|
||||||
|
|
Loading…
Reference in New Issue