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}
% Options
%
% \begin{macrocode}
\newif\if@beamer@metropolis@blockbg
\@beamer@metropolis@blockbgfalse
\DeclareOptionBeamer{blockbg}{
\@beamer@metropolis@blockbgtrue
}
% \end{macrocode}
%
% darkcolors
%
@ -57,7 +50,9 @@
\ProcessOptionsBeamer
% \end{macrocode}
%
% Colors
%
%
% \subsection{Base colors}
%
% \begin{macrocode}
\definecolor{mDarkBrown}{HTML}{604c38}
@ -66,7 +61,12 @@
\definecolor{mLightGreen}{HTML}{14B03D}
% \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}
\if@beamer@metropolis@darkcolors
@ -88,24 +88,33 @@
}
% \end{macrocode}
%
% Derived Colors
%
% \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}{%
fg=normal text.fg
}
% \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
% elements, and possibly of other elements.
% The metropolis color theme uses it for frame titles and slides.
% elements, and possibly of other elements. The \textsc{metropolis} theme uses
% it for frame titles and slides.
%
% \begin{macrocode}
\setbeamercolor{palette primary}{%
@ -113,11 +122,24 @@
fg=normal text.bg,
bg=normal text.fg
}
\setbeamercolor{frametitle}{%
use=palette primary,
parent=palette primary
}
% \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}
\setbeamercolor{progress bar}{%
use=alerted text,
fg=alerted text.fg,
bg=normal text.bg!50!normal text.fg
}
\setbeamercolor{title separator}{
use=progress bar,
parent=progress bar
@ -130,11 +152,6 @@
use=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}
%
% Blocks
@ -174,7 +191,8 @@
\setbeamercolor{footnote mark}{fg=.}
\mode<all>
% \end{macrocode}
%
%
%
% \iffalse
%</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}
%
% \begin{macro}{title page}
@ -49,9 +57,9 @@
% Template for the title page.
%
% \begin{macrocode}
\RequirePackage{tikz}
\setbeamertemplate{title page}{
\begin{minipage}[b][\paperheight]{\textwidth}
\vspace*{\@mtheme@voffset}
% \end{macrocode}
%
% If the user has set a |titlegraphic|, we set it in a zero-height box so
@ -145,11 +153,11 @@
}}
\fi
\vfill
\vspace*{\@mtheme@voffset}
\vspace*{1mm}
\end{minipage}
}
% \end{macrocode}
% \end{macro}
% \end{macro}%
%
% Normal people should use |\maketitle| or |\titlepage| instead of using the
% |title page| beamer template directly. Beamer already defines these macros,
@ -215,8 +223,8 @@
% StackExchange question}.
%
% \begin{macrocode}
\newcommand{\insertsectionHEAD}{\expandafter\formatsectionhead\insertsectionhead}
\newcommand{\formatsectionhead}[3]{#1{#2}{\mthemetitleformat{#3}}}
\providecommand{\insertsectionHEAD}{\expandafter\formatsectionhead\insertsectionhead}
\providecommand{\formatsectionhead}[3]{#1{#2}{\mthemetitleformat{#3}}}
% \end{macrocode}
% \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}
%
% All good |beamer| presentations should already remove the navigation symbols,

View File

@ -27,7 +27,11 @@
% \iffalse
%<*package>
% ------------------------------------------------------------------------- \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
@ -93,8 +97,10 @@
% blockbg
%
% \begin{macrocode}
\newif\if@beamer@metropolis@blockbg
\@beamer@metropolis@blockbgfalse
\DeclareOptionBeamer{blockbg}{
\PassOptionsToPackage{blockbg}{beamercolorthememetropolis}%
\@beamer@metropolis@blockbgtrue
}
% \end{macrocode}
%
@ -122,51 +128,51 @@
\def\mthemetitleformat#1{\scshape #1}
% \end{macrocode}
% \end{macro}
% \subsection{Component sub-packages}
%
% Having processed the options, we can now load the component sub-packages of
% the theme.
% \begin{macrocode}
\mode<presentation>
\useinnertheme{metropolis}
\useoutertheme{metropolis}
\usecolortheme{metropolis}
% \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}
\RequirePackage{etoolbox}
\RequirePackage{tikz}
\RequirePackage{pgfplots}
\RequirePackage{ifxetex,ifluatex}
\newif\ifxetexorluatex
\ifxetex
\xetexorluatextrue
\else
\ifluatex
\xetexorluatextrue
\else
\xetexorluatexfalse
\fi
\fi
\usetikzlibrary{backgrounds}
\usetikzlibrary{calc}
\usecolortheme{metropolis}
\ifxetexorluatex
\ifboolexpr{bool {xetex} or bool {luatex}}{
\usefonttheme{metropolis}
\else
\PackageWarning{beamerthemem}{You need to compile with XeLaTeX or LuaLaTeX for the Fira fonts.}
\fi
\useinnertheme{metropolis}%
\useoutertheme{metropolis}
}{
\PackageWarning{beamerthemem}{%
You need to compile with XeLaTeX or LuaLaTeX to use the Fira fonts.
}
}
% \end{macrocode}
%
% The |tol| theme for |pgfplots| is only loaded if |pgfplots| is used.
%
% \begin{macrocode}
\AtEndPreamble{%
\@ifpackageloaded{pgfplots}{%
\RequirePackage{pgfplotsthemetol}
}{}
}
% \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}
% Creates a plain frame with dark background, suitable for displaying images
% or a few words.
% \begin{macrocode}
\newcommand{\plain}[2][]{%
\begingroup
@ -185,16 +191,6 @@
% \end{macrocode}
% \end{macro}
%
%
%
%
%
%
%
% misc
%
%
% \begin{macro}{\mreducelistspacing}
% \begin{macrocode}
\newcommand{\mreducelistspacing}{\vspace{-\topsep}}

View File

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