Minor rearrangements and documentation

This commit is contained in:
Ross Churchley 2015-06-21 22:24:49 -07:00
parent cfb993ee2e
commit 15bcda7c37
5 changed files with 99 additions and 69 deletions

View File

@ -30,13 +30,6 @@
% \section{Implementation: \textsc{metropolis} color theme} % \section{Implementation: \textsc{metropolis} color theme}
% Options % Options
% %
% \begin{macrocode}
\newif\if@beamer@metropolis@blockbg
\@beamer@metropolis@blockbgfalse
\DeclareOptionBeamer{blockbg}{
\@beamer@metropolis@blockbgtrue
}
% \end{macrocode}
% %
% darkcolors % darkcolors
% %
@ -57,7 +50,9 @@
\ProcessOptionsBeamer \ProcessOptionsBeamer
% \end{macrocode} % \end{macrocode}
% %
% Colors %
%
% \subsection{Base colors}
% %
% \begin{macrocode} % \begin{macrocode}
\definecolor{mDarkBrown}{HTML}{604c38} \definecolor{mDarkBrown}{HTML}{604c38}
@ -66,7 +61,12 @@
\definecolor{mLightGreen}{HTML}{14B03D} \definecolor{mLightGreen}{HTML}{14B03D}
% \end{macrocode} % \end{macrocode}
% %
% Base Colors %
%
% \subsection{Base styles}
%
% All colors in the \textsc{metropolis} theme are derived from the definitions
% of |normal text|, |alerted text|, and |example text|.
% %
% \begin{macrocode} % \begin{macrocode}
\if@beamer@metropolis@darkcolors \if@beamer@metropolis@darkcolors
@ -88,24 +88,33 @@
} }
% \end{macrocode} % \end{macrocode}
% %
% Derived Colors
% %
% \begin{macrocode} % \begin{macrocode}
\setbeamercolor{titlelike}{use=normal text, parent=normal text} % \end{macrocode}
%
%
%
% \subsection{Derived colors}
%
% The titles and structural elements (e.g. |itemize| bullets) are set in the
% same color as |normal text|. This would ideally done by setting |normal text|
% as a parent style, which we do to set |titlelike|, but this doesn't work for
% |structure| as its foreground is set explicitly in
% |beamercolorthemedefault.sty|.
%
% \begin{macrocode}
\setbeamercolor{titlelike}{%
use=normal text,
parent=normal text
}
\setbeamercolor{structure}{% \setbeamercolor{structure}{%
fg=normal text.fg fg=normal text.fg
} }
% \end{macrocode} % \end{macrocode}
% %
% Frame titles and plain slides
%
% \begin{macrocode}
\setbeamercolor{frametitle}{use=palette primary, parent=palette primary}
% \end{macrocode}
%
% The “primary” palette should be used for the most important navigational % The “primary” palette should be used for the most important navigational
% elements, and possibly of other elements. % elements, and possibly of other elements. The \textsc{metropolis} theme uses
% The metropolis color theme uses it for frame titles and slides. % it for frame titles and slides.
% %
% \begin{macrocode} % \begin{macrocode}
\setbeamercolor{palette primary}{% \setbeamercolor{palette primary}{%
@ -113,11 +122,24 @@
fg=normal text.bg, fg=normal text.bg,
bg=normal text.fg bg=normal text.fg
} }
\setbeamercolor{frametitle}{%
use=palette primary,
parent=palette primary
}
% \end{macrocode} % \end{macrocode}
% %
% Progress bar and title separator % The \textsc{metropolis} inner or outer themes optionally display progress
% bars in various locations. Their color is set by |progress bar| but the two
% different kinds can be customized separately. The horizontal rule on the title
% page is also set based on the progress bar color and can be customized with
% |title separator|.
% %
% \begin{macrocode} % \begin{macrocode}
\setbeamercolor{progress bar}{%
use=alerted text,
fg=alerted text.fg,
bg=normal text.bg!50!normal text.fg
}
\setbeamercolor{title separator}{ \setbeamercolor{title separator}{
use=progress bar, use=progress bar,
parent=progress bar parent=progress bar
@ -130,11 +152,6 @@
use=progress bar, use=progress bar,
parent=progress bar parent=progress bar
} }
\setbeamercolor{progress bar}{%
use=alerted text,
fg=alerted text.fg,
bg=normal text.bg!50!normal text.fg
}
% \end{macrocode} % \end{macrocode}
% %
% Blocks % Blocks
@ -174,7 +191,8 @@
\setbeamercolor{footnote mark}{fg=.} \setbeamercolor{footnote mark}{fg=.}
\mode<all> \mode<all>
% \end{macrocode} % \end{macrocode}
%
%
% %
% \iffalse % \iffalse
%</package> %</package>

View File

@ -42,6 +42,14 @@
% %
% %
% %
% This customization will be changed in a future update.
%
% \begin{macrocode}
\def\mthemetitleformat{\scshape\MakeLowercase}
% \end{macrocode}
%
%
%
% \subsection{Title page} % \subsection{Title page}
% %
% \begin{macro}{title page} % \begin{macro}{title page}
@ -49,9 +57,9 @@
% Template for the title page. % Template for the title page.
% %
% \begin{macrocode} % \begin{macrocode}
\RequirePackage{tikz}
\setbeamertemplate{title page}{ \setbeamertemplate{title page}{
\begin{minipage}[b][\paperheight]{\textwidth} \begin{minipage}[b][\paperheight]{\textwidth}
\vspace*{\@mtheme@voffset}
% \end{macrocode} % \end{macrocode}
% %
% If the user has set a |titlegraphic|, we set it in a zero-height box so % If the user has set a |titlegraphic|, we set it in a zero-height box so
@ -145,11 +153,11 @@
}} }}
\fi \fi
\vfill \vfill
\vspace*{\@mtheme@voffset} \vspace*{1mm}
\end{minipage} \end{minipage}
} }
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}%
% %
% Normal people should use |\maketitle| or |\titlepage| instead of using the % Normal people should use |\maketitle| or |\titlepage| instead of using the
% |title page| beamer template directly. Beamer already defines these macros, % |title page| beamer template directly. Beamer already defines these macros,
@ -215,8 +223,8 @@
% StackExchange question}. % StackExchange question}.
% %
% \begin{macrocode} % \begin{macrocode}
\newcommand{\insertsectionHEAD}{\expandafter\formatsectionhead\insertsectionhead} \providecommand{\insertsectionHEAD}{\expandafter\formatsectionhead\insertsectionhead}
\newcommand{\formatsectionhead}[3]{#1{#2}{\mthemetitleformat{#3}}} \providecommand{\formatsectionhead}[3]{#1{#2}{\mthemetitleformat{#3}}}
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
% %

View File

@ -34,6 +34,13 @@
% %
% %
% %
% This customization will be removed in a future version.
%
% \begin{macrocode}
\def\mthemetitleformat{\scshape\MakeLowercase}
% \end{macrocode}
%
%
% \subsection{Head and footline} % \subsection{Head and footline}
% %
% All good |beamer| presentations should already remove the navigation symbols, % All good |beamer| presentations should already remove the navigation symbols,

View File

@ -27,7 +27,11 @@
% \iffalse % \iffalse
%<*package> %<*package>
% ------------------------------------------------------------------------- \fi % ------------------------------------------------------------------------- \fi
% \section{Implementation: \textsc{metropolis} main theme}
% %
% The primary job of this package is to load the component sub-packages of the
% \textsc{metropolis} theme and route the theme options accordingly. It also
% provides some custom commands and environments for the user.
% %
% %
% Options % Options
@ -93,8 +97,10 @@
% blockbg % blockbg
% %
% \begin{macrocode} % \begin{macrocode}
\newif\if@beamer@metropolis@blockbg
\@beamer@metropolis@blockbgfalse
\DeclareOptionBeamer{blockbg}{ \DeclareOptionBeamer{blockbg}{
\PassOptionsToPackage{blockbg}{beamercolorthememetropolis}% \@beamer@metropolis@blockbgtrue
} }
% \end{macrocode} % \end{macrocode}
% %
@ -122,51 +128,51 @@
\def\mthemetitleformat#1{\scshape #1} \def\mthemetitleformat#1{\scshape #1}
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
% \subsection{Component sub-packages}
% %
% Having processed the options, we can now load the component sub-packages of
% the theme.
% \begin{macrocode} % \begin{macrocode}
\mode<presentation> \useinnertheme{metropolis}
\useoutertheme{metropolis}
\usecolortheme{metropolis}
% \end{macrocode} % \end{macrocode}
% %
% Packages % The |fira| font theme, which depends on |fontspec|, is only loaded if the
% document is being processed by Xe\LaTeX{} or Lua\LaTeX{}.
% %
% \begin{macrocode} % \begin{macrocode}
\RequirePackage{etoolbox} \RequirePackage{etoolbox}
\RequirePackage{tikz}
\RequirePackage{pgfplots}
\RequirePackage{ifxetex,ifluatex} \RequirePackage{ifxetex,ifluatex}
\newif\ifxetexorluatex \ifboolexpr{bool {xetex} or bool {luatex}}{
\ifxetex
\xetexorluatextrue
\else
\ifluatex
\xetexorluatextrue
\else
\xetexorluatexfalse
\fi
\fi
\usetikzlibrary{backgrounds}
\usetikzlibrary{calc}
\usecolortheme{metropolis}
\ifxetexorluatex
\usefonttheme{metropolis} \usefonttheme{metropolis}
\else }{
\PackageWarning{beamerthemem}{You need to compile with XeLaTeX or LuaLaTeX for the Fira fonts.} \PackageWarning{beamerthemem}{%
\fi You need to compile with XeLaTeX or LuaLaTeX to use the Fira fonts.
}
\useinnertheme{metropolis}% }
\useoutertheme{metropolis} % \end{macrocode}
%
% The |tol| theme for |pgfplots| is only loaded if |pgfplots| is used.
%
% \begin{macrocode}
\AtEndPreamble{% \AtEndPreamble{%
\@ifpackageloaded{pgfplots}{% \@ifpackageloaded{pgfplots}{%
\RequirePackage{pgfplotsthemetol} \RequirePackage{pgfplotsthemetol}
}{} }{}
} }
% \end{macrocode} % \end{macrocode}
% %
% Create a plain frame with dark background %
%
% \subsection{Custom commands}
%
% We define custom commands in this package as their proper usage may depend
% depend on multiple sub-packages.
% %
% \begin{macro}{\plain} % \begin{macro}{\plain}
% Creates a plain frame with dark background, suitable for displaying images
% or a few words.
% \begin{macrocode} % \begin{macrocode}
\newcommand{\plain}[2][]{% \newcommand{\plain}[2][]{%
\begingroup \begingroup
@ -185,16 +191,6 @@
% \end{macrocode} % \end{macrocode}
% \end{macro} % \end{macro}
% %
%
%
%
%
%
%
% misc
%
%
% \begin{macro}{\mreducelistspacing} % \begin{macro}{\mreducelistspacing}
% \begin{macrocode} % \begin{macrocode}
\newcommand{\mreducelistspacing}{\vspace{-\topsep}} \newcommand{\mreducelistspacing}{\vspace{-\topsep}}

View File

@ -6,6 +6,7 @@
\usepackage{booktabs} \usepackage{booktabs}
\usepackage[scale=2]{ccicons} \usepackage[scale=2]{ccicons}
\usepackage{pgfplots}
\usepgfplotslibrary{dateplot} \usepgfplotslibrary{dateplot}