mirror of https://github.com/matze/mtheme.git
First working pgfopts implementation
This commit is contained in:
parent
f15d18ed05
commit
9b19181fc0
|
@ -27,28 +27,54 @@
|
|||
% \iffalse
|
||||
%<*package>
|
||||
% ------------------------------------------------------------------------- \fi
|
||||
%
|
||||
% \section{Implementation: \textsc{metropolis} color theme}
|
||||
% Options
|
||||
%
|
||||
%
|
||||
% darkcolors
|
||||
%
|
||||
% Load required packages.
|
||||
% \begin{macrocode}
|
||||
\newif\if@beamer@metropolis@darkcolors
|
||||
\@beamer@metropolis@darkcolorsfalse
|
||||
\DeclareOptionBeamer{darkcolors}{
|
||||
\@beamer@metropolis@darkcolorstrue
|
||||
}
|
||||
\RequirePackage{pgfopts}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% Unknown option error handling
|
||||
%
|
||||
%
|
||||
% \subsection{Options}
|
||||
%
|
||||
% \begin{macro}{block}
|
||||
% This option controls whether the blocks are filled or transparent.
|
||||
% \begin{macrocode}
|
||||
\DeclareOptionBeamer*{%
|
||||
\PackageWarning{beamercolorthememetropolis}{Unknown option `\CurrentOption'}%
|
||||
\pgfkeys{
|
||||
/metropolis/color/block/.cd,
|
||||
.is choice,
|
||||
transparent/.code=\@metropolis@block@transparent,
|
||||
fill/.code=\@metropolis@block@fill,
|
||||
}
|
||||
\ProcessOptionsBeamer
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% \begin{macro}{colors}
|
||||
% Defines whether the background shall be dark and the foreground be light or
|
||||
% vice versa
|
||||
% \begin{macrocode}
|
||||
\pgfkeys{
|
||||
/metropolis/color/background/.cd,
|
||||
.is choice,
|
||||
dark/.code=\@metropolis@colors@dark,
|
||||
light/.code=\@metropolis@colors@light,
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% \begin{macro}{\@metropolis@color@setdefaults}
|
||||
% Set default values for color theme options.
|
||||
% \begin{macrocode}
|
||||
\newcommand{\@metropolis@color@setdefaults}{
|
||||
\pgfkeys{/metropolis/color/.cd,
|
||||
background=light,
|
||||
block=transparent,
|
||||
}
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
%
|
||||
%
|
||||
|
@ -69,17 +95,18 @@
|
|||
% of |normal text|, |alerted text|, and |example text|.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\if@beamer@metropolis@darkcolors
|
||||
\newcommand{\@metropolis@colors@dark}{
|
||||
\setbeamercolor{normal text}{%
|
||||
fg=black!2,
|
||||
bg=mDarkTeal
|
||||
}
|
||||
\else
|
||||
}
|
||||
\newcommand{\@metropolis@colors@light}{
|
||||
\setbeamercolor{normal text}{%
|
||||
fg=mDarkTeal,
|
||||
bg=black!2
|
||||
}
|
||||
\fi
|
||||
}
|
||||
\setbeamercolor{alerted text}{%
|
||||
fg=mLightBrown
|
||||
}
|
||||
|
@ -89,10 +116,6 @@
|
|||
% \end{macrocode}
|
||||
%
|
||||
%
|
||||
% \begin{macrocode}
|
||||
% \end{macrocode}
|
||||
%
|
||||
%
|
||||
%
|
||||
% \subsection{Derived colors}
|
||||
%
|
||||
|
@ -130,9 +153,9 @@
|
|||
%
|
||||
% 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|.
|
||||
% 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}{%
|
||||
|
@ -157,15 +180,16 @@
|
|||
% Blocks
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\if@beamer@metropolis@blockbg
|
||||
\newcommand{\@metropolis@block@transparent}{
|
||||
\setbeamercolor{block title}{use=normal text, parent=normal text}
|
||||
}
|
||||
\newcommand{\@metropolis@block@fill}{
|
||||
\setbeamercolor{block title}{%
|
||||
use=normal text,
|
||||
fg=normal text.fg,
|
||||
bg=normal text.bg!80!fg
|
||||
}
|
||||
\else
|
||||
\setbeamercolor{block title}{use=normal text, parent=normal text}
|
||||
\fi
|
||||
}
|
||||
\setbeamercolor{block title alerted}{%
|
||||
use={block title, alerted text},
|
||||
bg=block title.bg,
|
||||
|
@ -189,10 +213,18 @@
|
|||
% \begin{macrocode}
|
||||
\setbeamercolor{footnote}{fg=normal text.fg!90}
|
||||
\setbeamercolor{footnote mark}{fg=.}
|
||||
\mode<all>
|
||||
% \end{macrocode}
|
||||
%
|
||||
% Process package options
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\@metropolis@color@setdefaults
|
||||
\ProcessPgfPackageOptions{/metropolis/color}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\mode<all>
|
||||
% \end{macrocode}
|
||||
%
|
||||
% \iffalse
|
||||
%</package>
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
% \iffalse
|
||||
%<*package>
|
||||
% ------------------------------------------------------------------------- \fi
|
||||
%
|
||||
% \section{Implementation: \textsc{metropolis} inner theme}
|
||||
%
|
||||
% A |beamer| inner theme dictates the style of the frame elements traditionally
|
||||
|
@ -40,14 +41,60 @@
|
|||
% \item footnotes and plain text.
|
||||
% \end{itemize}
|
||||
%
|
||||
% Load required packages.
|
||||
% \begin{macrocode}
|
||||
\RequirePackage{calc}
|
||||
\RequirePackage{pgfopts}
|
||||
\RequirePackage{tikz}
|
||||
% \end{macrocode}
|
||||
%
|
||||
%
|
||||
%
|
||||
% \subsection{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}
|
||||
% The |sectionpage| option defines the behaviour of the sectionpage.
|
||||
% \begin{macrocode}
|
||||
\pgfkeys{
|
||||
/metropolis/inner/sectionpage/.cd,
|
||||
.is choice,
|
||||
none/.code=\@metropolis@sectionpage@none,
|
||||
progressbar/.code=\@metropolis@sectionpage@progressbar,
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% \begin{macro}{\@metropolis@inner@setdefaults}
|
||||
% Set default values for inner theme options.
|
||||
% \begin{macrocode}
|
||||
\newcommand{\@metropolis@inner@setdefaults}{
|
||||
\pgfkeys{/metropolis/inner/.cd,
|
||||
sectionpage=progressbar,
|
||||
block=transparent,
|
||||
}
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
%
|
||||
%
|
||||
% \subsection{Title page}
|
||||
%
|
||||
% \begin{macro}{title page}
|
||||
%
|
||||
% Template for the title page.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\RequirePackage{tikz}
|
||||
\setbeamertemplate{title page}{
|
||||
\begin{minipage}[b][\paperheight]{\textwidth}
|
||||
% \end{macrocode}
|
||||
|
@ -78,7 +125,7 @@
|
|||
\linespread{1.0}%
|
||||
\usebeamerfont{title}%
|
||||
\usebeamercolor[fg]{title}%
|
||||
\mthemetitleformat{\inserttitle}%
|
||||
\@metropolis@titleformat{\inserttitle}%
|
||||
\par%
|
||||
\vspace*{0.5em}
|
||||
}}
|
||||
|
@ -184,7 +231,12 @@
|
|||
% Template for the section title slide at the beginning of each section.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\setbeamertemplate{section page}{
|
||||
\newcommand{\@metropolis@sectionpage@none}{
|
||||
\AtBeginSection{
|
||||
% intenionally empty
|
||||
}
|
||||
}
|
||||
\defbeamertemplate{section page}{progressbar}{
|
||||
\vspace{2em}
|
||||
\centering
|
||||
\begin{minipage}{22em}
|
||||
|
@ -195,7 +247,8 @@
|
|||
\end{minipage}
|
||||
\par
|
||||
}
|
||||
\if@noSectionSlide\else%
|
||||
\newcommand{\@metropolis@sectionpage@progressbar}{
|
||||
\setbeamertemplate{section page}[progressbar]
|
||||
\AtBeginSection{
|
||||
\ifbeamer@inframe
|
||||
\sectionpage
|
||||
|
@ -203,7 +256,7 @@
|
|||
\frame[plain,c]{\sectionpage}
|
||||
\fi
|
||||
}
|
||||
\fi
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
|
@ -214,7 +267,6 @@
|
|||
% |progress bar in head/foot|.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\RequirePackage{calc}
|
||||
\newlength{\metropolis@progressonsectionpage}
|
||||
\setbeamertemplate{progress bar in section page}{
|
||||
\setlength{\metropolis@progressonsectionpage}{%
|
||||
|
@ -247,27 +299,22 @@
|
|||
% \subsection{Block environments}
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\newlength{\leftrightskip}
|
||||
\if@beamer@metropolis@blockbg
|
||||
\setlength{\leftrightskip}{1ex}
|
||||
\else
|
||||
\setlength{\leftrightskip}{0ex}
|
||||
\fi
|
||||
\newlength{\@metropolis@blockskip}
|
||||
\setbeamertemplate{block begin}{%
|
||||
\vspace*{1ex}
|
||||
\begin{beamercolorbox}[%
|
||||
ht=2.4ex,
|
||||
dp=1ex,
|
||||
leftskip=\leftrightskip,
|
||||
rightskip=\leftrightskip]{block title}
|
||||
leftskip=\@metropolis@blockskip,
|
||||
rightskip=\@metropolis@blockskip]{block title}
|
||||
\usebeamerfont*{block title}\insertblocktitle%
|
||||
\end{beamercolorbox}%
|
||||
\vspace*{-1pt}
|
||||
\usebeamerfont{block body}%
|
||||
\begin{beamercolorbox}[%
|
||||
dp=1ex,
|
||||
leftskip=\leftrightskip,
|
||||
rightskip=\leftrightskip,
|
||||
leftskip=\@metropolis@blockskip,
|
||||
rightskip=\@metropolis@blockskip,
|
||||
vmode]{block body}%
|
||||
}
|
||||
\setbeamertemplate{block end}{%
|
||||
|
@ -284,16 +331,16 @@
|
|||
\begin{beamercolorbox}[%
|
||||
ht=2.4ex,
|
||||
dp=1ex,
|
||||
leftskip=\leftrightskip,
|
||||
rightskip=\leftrightskip]{block title alerted}
|
||||
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=\leftrightskip,
|
||||
rightskip=\leftrightskip,
|
||||
leftskip=\@metropolis@blockskip,
|
||||
rightskip=\@metropolis@blockskip,
|
||||
vmode]{block body}%
|
||||
}
|
||||
\setbeamertemplate{block alerted end}{%
|
||||
|
@ -310,16 +357,16 @@
|
|||
\begin{beamercolorbox}[%
|
||||
ht=2.4ex,
|
||||
dp=1ex,
|
||||
leftskip=\leftrightskip,
|
||||
rightskip=\leftrightskip]{block title example}
|
||||
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=\leftrightskip,
|
||||
rightskip=\leftrightskip,
|
||||
leftskip=\@metropolis@blockskip,
|
||||
rightskip=\@metropolis@blockskip,
|
||||
vmode]{block body}%
|
||||
}
|
||||
\setbeamertemplate{block example end}{%
|
||||
|
@ -340,12 +387,16 @@
|
|||
\setbeamertemplate{itemize subsubitem}{\textbullet}
|
||||
% \end{macrocode}
|
||||
%
|
||||
%
|
||||
%
|
||||
% \subsection{Figures and tables}
|
||||
% \begin{macrocode}
|
||||
\setbeamertemplate{caption label separator}{: }
|
||||
\setbeamertemplate{caption}[numbered]
|
||||
% \end{macrocode}
|
||||
%
|
||||
%
|
||||
%
|
||||
% \subsection{Footnotes}
|
||||
% \begin{macrocode}
|
||||
\setbeamertemplate{footnote}{%
|
||||
|
@ -355,14 +406,21 @@
|
|||
}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% \subsection{General text}
|
||||
%
|
||||
%
|
||||
% \subsection{General text settings}
|
||||
% \begin{macrocode}
|
||||
\mode<all>
|
||||
\setlength{\parskip}{0.5em}
|
||||
\linespread{1.15}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% Process package options
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\@metropolis@inner@setdefaults
|
||||
\ProcessPgfPackageOptions{/metropolis/inner}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% \iffalse
|
||||
%</package>
|
||||
|
|
|
@ -27,20 +27,73 @@
|
|||
% \iffalse
|
||||
%<*package>
|
||||
% ------------------------------------------------------------------------- \fi
|
||||
%
|
||||
% \section{Implementation: \textsc{metropolis} outer theme}
|
||||
%
|
||||
% A |beamer| outer theme dictates the style of the frame elements traditionally
|
||||
% set outside the body of each slide: the head, footline, and frame title.
|
||||
%
|
||||
%
|
||||
%
|
||||
% This customization will be removed in a future version.
|
||||
%
|
||||
% Load required packages.
|
||||
% \begin{macrocode}
|
||||
\def\mthemetitleformat{\scshape\MakeLowercase}
|
||||
\RequirePackage{calc}
|
||||
\RequirePackage{pgfopts}
|
||||
% \end{macrocode}
|
||||
%
|
||||
%
|
||||
%
|
||||
% \subsection{Options}
|
||||
%
|
||||
% \begin{macro}{numbering}
|
||||
% This option controls the page numbering.
|
||||
% \begin{macrocode}
|
||||
\pgfkeys{
|
||||
/metropolis/outer/numbering/.cd,
|
||||
.is choice,
|
||||
none/.code=\setbeamertemplate{frame numbering}[none],
|
||||
counter/.code=\setbeamertemplate{frame numbering}[counter],
|
||||
fraction/.code=\setbeamertemplate{frame numbering}[fraction],
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% \begin{macro}{progressbar}
|
||||
% This option controls the progressbar.
|
||||
% \begin{macrocode}
|
||||
\pgfkeys{
|
||||
/metropolis/outer/progressbar/.cd,
|
||||
.is choice,
|
||||
none/.code=\setbeamertemplate{progress bar in head/foot}[none],
|
||||
head/.code=\setbeamertemplate{progress bar in head/foot}[head],
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% \begin{macro}{frametitleoffset}
|
||||
% This option controls the frame title offset.
|
||||
% \begin{macrocode}
|
||||
\pgfkeys{
|
||||
/metropolis/outer/.cd,
|
||||
frametitleoffset/.code=\setlength{\@metropolis@voffset}{#1},
|
||||
noframetitleoffset/.code=\setlength{\@metropolis@voffset}{0em},
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% \begin{macro}{\@metropolis@outer@setdefaults}
|
||||
% Set default values for outer theme options.
|
||||
% \begin{macrocode}
|
||||
\newcommand{\@metropolis@outer@setdefaults}{
|
||||
\pgfkeys{/metropolis/outer/.cd,
|
||||
numbering=counter,
|
||||
progressbar=none,
|
||||
frametitleoffset=2em,
|
||||
}
|
||||
}
|
||||
% \end{macrocode}%
|
||||
% \end{macro}
|
||||
%
|
||||
%
|
||||
%
|
||||
% \subsection{Head and footline}
|
||||
%
|
||||
% All good |beamer| presentations should already remove the navigation symbols,
|
||||
|
@ -50,8 +103,28 @@
|
|||
\setbeamertemplate{navigation symbols}{}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% The only element in the footline by default is the frame number. It can
|
||||
% optionally be omitted or displayed as a fraction of the total frames.
|
||||
% Template for the frame number. Can be omitted, shown or displayed as a
|
||||
% fraction of the total frames.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\defbeamertemplate{frame numbering}{none}{
|
||||
% intentionally empty
|
||||
}
|
||||
\defbeamertemplate{frame numbering}{counter}{
|
||||
\insertframenumber
|
||||
}
|
||||
\defbeamertemplate{frame numbering}{fraction}{
|
||||
\insertframenumber/\inserttotalframenumber
|
||||
}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% Define additional space between frame title and content. By default 2em.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\newlength{\@metropolis@voffset}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% The only element in the footline by default is the frame number.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\setbeamertemplate{footline}{%
|
||||
|
@ -62,16 +135,8 @@
|
|||
leftskip=0.3cm,
|
||||
rightskip=0.3cm
|
||||
]{footline}%
|
||||
\hfill\usebeamerfont{page number in head/foot}%
|
||||
\if@noSlideNumbers%
|
||||
%Purposefully left blank to display no slide number.%
|
||||
\else%
|
||||
\if@useTotalSlideIndicator%
|
||||
\insertframenumber/\inserttotalframenumber%
|
||||
\else%
|
||||
\insertframenumber%
|
||||
\fi%
|
||||
\fi%
|
||||
\hfill\usebeamerfont{page number in head/foot}%
|
||||
\usebeamertemplate*{frame numbering}
|
||||
\end{beamercolorbox}%
|
||||
}
|
||||
% \end{macrocode}
|
||||
|
@ -97,11 +162,8 @@
|
|||
]{frametitle}
|
||||
\insertframetitle%
|
||||
\end{beamercolorbox}%
|
||||
\if@useTitleProgressBar
|
||||
\nointerlineskip
|
||||
\usebeamertemplate*{progress bar in head/foot}
|
||||
\fi
|
||||
\vspace{\@mtheme@voffset}
|
||||
\usebeamertemplate*{progress bar in head/foot}
|
||||
\vspace{\@metropolis@voffset}
|
||||
}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
|
@ -113,13 +175,17 @@
|
|||
% |progress bar in section page|.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\RequirePackage{calc}
|
||||
\newlength{\metropolis@progressinheadfoot}
|
||||
\setbeamertemplate{progress bar in head/foot}{
|
||||
\defbeamertemplate{progress bar in head/foot}{none}{}
|
||||
\defbeamertemplate{progress bar in head/foot}{head}{
|
||||
\nointerlineskip
|
||||
\setlength{\metropolis@progressinheadfoot}{%
|
||||
\paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
|
||||
}%
|
||||
\begin{beamercolorbox}[wd=\paperwidth,ht=0.4pt,dp=0pt]{progress bar in head/foot}
|
||||
\begin{beamercolorbox}[
|
||||
wd=\paperwidth,
|
||||
ht=0.4pt,
|
||||
dp=0pt]{progress bar in head/foot}
|
||||
\begin{tikzpicture}
|
||||
\draw[bg, fill=bg] (0,0) rectangle (\paperwidth, 0.4pt);
|
||||
\draw[fg, fill=fg] (0,0) rectangle (\metropolis@progressinheadfoot, 0.4pt);
|
||||
|
@ -129,7 +195,12 @@
|
|||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% Process package options
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\@metropolis@outer@setdefaults
|
||||
\ProcessPgfPackageOptions{/metropolis/outer}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% \iffalse
|
||||
%</package>
|
||||
|
|
141
beamerthemem.dtx
141
beamerthemem.dtx
|
@ -27,89 +27,75 @@
|
|||
% \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.
|
||||
%
|
||||
% Load the required packages.
|
||||
% \begin{macrocode}
|
||||
\RequirePackage{etoolbox}
|
||||
\RequirePackage{pgfopts}
|
||||
\RequirePackage{ifxetex}
|
||||
\RequirePackage{ifluatex}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% Options
|
||||
% \subsection{Options}
|
||||
%
|
||||
% \begin{macro}{\setmetropolis}
|
||||
% First of all we define a macro for the user to set options.
|
||||
% \begin{macrocode}
|
||||
\newcommand{\setmetropolis}[1]{\pgfkeys{/metropolis/.cd,#1}}
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% Then we need to pass the unknown options to the sub-packages.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\newif\if@useTitleProgressBar
|
||||
\@useTitleProgressBarfalse
|
||||
\DeclareOptionBeamer{usetitleprogressbar}{
|
||||
\@useTitleProgressBartrue
|
||||
\pgfkeys{/metropolis/.cd,
|
||||
.search also={
|
||||
/metropolis/inner,
|
||||
/metropolis/outer,
|
||||
/metropolis/color,
|
||||
},
|
||||
% \end{macrocode}
|
||||
%
|
||||
% We have to forwarded keys that affect multiple sub-packages manually.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
block/.code=\pgfkeysalso{
|
||||
inner/block=#1,
|
||||
color/block=#1,
|
||||
}
|
||||
}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% usetotalslideindicator
|
||||
% For backwards compatibility with earlier betas of the theme, we implement
|
||||
% deprecated option names as aliases to the corresponding |key=value| options.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\newif\if@useTotalSlideIndicator
|
||||
\@useTotalSlideIndicatorfalse
|
||||
\DeclareOptionBeamer{usetotalslideindicator}{
|
||||
\@useTotalSlideIndicatortrue
|
||||
\pgfkeys{/metropolis/.cd,
|
||||
usetitleprogressbar/.code=\pgfkeysalso{outer/progressbar=head},
|
||||
noslidenumbers/.code=\pgfkeysalso{outer/numbering=none},
|
||||
usetotalslideindicator/.code=\pgfkeysalso{outer/numbering=fraction},
|
||||
nosectionslide/.code=\pgfkeysalso{inner/sectionpage=none},
|
||||
darkcolors/.code=\pgfkeysalso{color/background=dark},
|
||||
blockbg/.code=\pgfkeysalso{color/block=fill, inner/block=fill},
|
||||
}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% noslidenumbers
|
||||
% Set default values for options.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\newif\if@noSlideNumbers
|
||||
\@noSlideNumbersfalse
|
||||
\DeclareOptionBeamer{noslidenumbers}{
|
||||
\@noSlideNumberstrue
|
||||
\newcommand{\@metropolis@setdefaults}{
|
||||
\pgfkeys{/metropolis/.cd,
|
||||
}
|
||||
}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% nosectionslide
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\newif\if@noSectionSlide
|
||||
\@noSectionSlidefalse
|
||||
\DeclareOptionBeamer{nosectionslide}{
|
||||
\@noSectionSlidetrue
|
||||
}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% nooffset
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\newlength{\@mtheme@voffset}
|
||||
\setlength{\@mtheme@voffset}{2em}
|
||||
\DeclareOptionBeamer{nooffset}{
|
||||
\setlength{\@mtheme@voffset}{0em}
|
||||
}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% blockbg
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\newif\if@beamer@metropolis@blockbg
|
||||
\@beamer@metropolis@blockbgfalse
|
||||
\DeclareOptionBeamer{blockbg}{
|
||||
\@beamer@metropolis@blockbgtrue
|
||||
}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% darkcolors
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\DeclareOptionBeamer{darkcolors}{
|
||||
\PassOptionsToPackage{darkcolors}{beamercolorthememetropolis}%
|
||||
}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% Unknown option error handling
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\DeclareOptionBeamer*{
|
||||
\PackageWarning{beamerthemem}{Unknown option `\CurrentOption'}%
|
||||
}
|
||||
\ProcessOptionsBeamer
|
||||
% \end{macrocode}
|
||||
%
|
||||
% \subsection{Component sub-packages}
|
||||
%
|
||||
|
@ -125,8 +111,6 @@
|
|||
% document is being processed by Xe\LaTeX{} or Lua\LaTeX{}.
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\RequirePackage{etoolbox}
|
||||
\RequirePackage{ifxetex,ifluatex}
|
||||
\ifboolexpr{bool {xetex} or bool {luatex}}{
|
||||
\usefonttheme{metropolis}
|
||||
}{
|
||||
|
@ -146,21 +130,23 @@
|
|||
}
|
||||
% \end{macrocode}
|
||||
%
|
||||
%
|
||||
%
|
||||
% \subsection{Custom commands}
|
||||
%
|
||||
% We define custom commands in this package as their proper usage may depend
|
||||
% on multiple sub-packages.
|
||||
%
|
||||
% \begin{macro}{\mthemetitleformat}
|
||||
% \begin{macro}{\mthemesectiontitleformat}
|
||||
% \begin{macro}{\mthemeframetitleformat}
|
||||
% \begin{macro}{\mthemeplaintitleformat}
|
||||
% \begin{macro}{\@metropolis@titleformat}
|
||||
% \begin{macro}{\@metropolis@sectiontitleformat}
|
||||
% \begin{macro}{\@metropolis@frametitleformat}
|
||||
% \begin{macro}{\@metropolis@plaintitleformat}
|
||||
% Creates hooks to change the case format of the four different titles.
|
||||
% \begin{macrocode}
|
||||
\def\mthemetitleformat#1{\MakeLowercase{#1}}
|
||||
\def\mthemesectiontitleformat#1{\mthemetitleformat{#1}}
|
||||
\def\mthemeframetitleformat#1{\mthemetitleformat{#1}}
|
||||
\def\mthemeplaintitleformat#1{\mthemetitleformat{#1}}
|
||||
\def\@metropolis@titleformat#1{\MakeLowercase{#1}}
|
||||
\def\@metropolis@sectiontitleformat#1{\@metropolis@titleformat{#1}}
|
||||
\def\@metropolis@frametitleformat#1{\@metropolis@titleformat{#1}}
|
||||
\def\@metropolis@plaintitleformat#1{\@metropolis@titleformat{#1}}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% To give users the option to |\MakeUppercase| or |\MakeLowercase| the
|
||||
|
@ -173,11 +159,11 @@
|
|||
% \begin{macrocode}
|
||||
\patchcmd{\sectionentry}
|
||||
{\def\insertsectionhead{#2}}
|
||||
{\def\insertsectionhead{\mthemesectiontitleformat{#2}}}
|
||||
{\def\insertsectionhead{\@metropolis@sectiontitleformat{#2}}}
|
||||
{}{}
|
||||
\patchcmd{\beamer@section}
|
||||
{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
|
||||
{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{\mthemesectiontitleformat{#1}}}}
|
||||
{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{\@metropolis@sectiontitleformat{#1}}}}
|
||||
{}{}
|
||||
|
||||
\patchcmd{\beamer@@frametitle}
|
||||
|
@ -187,7 +173,7 @@
|
|||
\gdef\beamer@shortframetitle{#1}%
|
||||
}}
|
||||
{\beamer@ifempty{#2}{}{%
|
||||
\gdef\insertframetitle{{\mthemeframetitleformat{#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}%
|
||||
}}
|
||||
|
@ -211,7 +197,7 @@
|
|||
\vspace{1em}
|
||||
\usebeamercolor[fg]{palette primary}
|
||||
\usebeamerfont{section title}
|
||||
\mthemeplaintitleformat{#2}
|
||||
\@metropolis@plaintitleformat{#2}
|
||||
\vfill
|
||||
\end{frame}
|
||||
\endgroup
|
||||
|
@ -225,6 +211,13 @@
|
|||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
% Process package options
|
||||
%
|
||||
% \begin{macrocode}
|
||||
\@metropolis@setdefaults
|
||||
\ProcessPgfOptions{/metropolis}
|
||||
% \end{macrocode}
|
||||
%
|
||||
% \iffalse
|
||||
%</package>
|
||||
% \fi
|
||||
|
|
6
demo.tex
6
demo.tex
|
@ -2,6 +2,12 @@
|
|||
|
||||
\usetheme{m}
|
||||
|
||||
\setmetropolis{
|
||||
sectionpage=none,
|
||||
block=fill,
|
||||
numbering=fraction,
|
||||
}
|
||||
|
||||
\usepackage{booktabs}
|
||||
\usepackage[scale=2]{ccicons}
|
||||
|
||||
|
|
10
mtheme.dtx
10
mtheme.dtx
|
@ -62,7 +62,7 @@
|
|||
xrightmargin=0em,
|
||||
aboveskip=1em,
|
||||
belowskip=1em,
|
||||
morekeywords={usetheme,institute,maketitle,mthemetitleformat,plain,setbeamercolor},
|
||||
morekeywords={usetheme,institute,maketitle,@metropolis@titleformat,plain,setbeamercolor},
|
||||
}
|
||||
\lstMakeShortInline|
|
||||
|
||||
|
@ -238,17 +238,17 @@ colors in |beamercolorthememetropolis|, including progress bar.
|
|||
\subsection{Title Case Formatting}
|
||||
|
||||
The main title, section titles, frame titles and plain frame titles are all
|
||||
formatted according to the custom command |\mthemetitleformat|. By default,
|
||||
formatted according to the custom command |\@metropolis@titleformat|. By default,
|
||||
this is equivalent to |\MakeLowercase{#1}|, hence seting the titles in small
|
||||
capitals. You can change this behaviour in your preamble. For example:
|
||||
|
||||
\begin{lstlisting}
|
||||
% camel case
|
||||
\renewcommand{\mthemetitleformat}{}
|
||||
\renewcommand{\@metropolis@titleformat}{}
|
||||
% lowercase
|
||||
\renewcommand{\mthemetitleformat}\MakeLowercase}
|
||||
\renewcommand{\@metropolis@titleformat}\MakeLowercase}
|
||||
% uppercase
|
||||
\renewcommand{\mthemetitleformat}{\MakeUppercase}
|
||||
\renewcommand{\@metropolis@titleformat}{\MakeUppercase}
|
||||
\end{lstlisting}
|
||||
|
||||
Be aware that these formatting macros will be replaced with theme options in
|
||||
|
|
BIN
mtheme.pdf
BIN
mtheme.pdf
Binary file not shown.
Loading…
Reference in New Issue