1
0
mirror of https://github.com/matze/mtheme.git synced 2024-06-28 07:40:52 +02:00

Reorganize and document package options

This commit is contained in:
Ross Churchley 2015-06-06 00:41:09 -07:00
parent 64e3701761
commit e77fa67565

View File

@ -9,41 +9,90 @@
\ProvidesPackage{beamerthemem} \ProvidesPackage{beamerthemem}
%{{{ --- Options ----------------------
% Options & customization
% =======================
%
% To use any of options below, call them when invoking `mtheme` in the
% preamble of your slides:
%
% \usetheme[<options>]{m}
%
% Option: usetitleprogressbar
% adds a thin progress bar underneath each frame title
\newif\if@useTitleProgressBar \newif\if@useTitleProgressBar
\newif\if@protectFrameTitle
\newif\if@noSectionSlide
\newif\if@useTotalSlideIndicator
\newif\if@noSlideNumbers
\@useTitleProgressBarfalse \@useTitleProgressBarfalse
\@protectFrameTitlefalse \DeclareOptionBeamer{usetitleprogressbar}{
\@noSectionSlidefalse \@useTitleProgressBartrue
}
% Option: usetotalslideindicator
% formats slide numbering as #current/#total
\newif\if@useTotalSlideIndicator
\@useTotalSlideIndicatorfalse \@useTotalSlideIndicatorfalse
\DeclareOptionBeamer{usetotalslideindicator}{
\@useTotalSlideIndicatortrue
}
% Option: noslidenumbers
% omits slide numbering entirely
\newif\if@noSlideNumbers
\@noSlideNumbersfalse \@noSlideNumbersfalse
\DeclareOptionBeamer{noslidenumbers}{
\@noSlideNumberstrue
}
% Option: nosectionslide
% omits the dedicated slide at the start of each new section
\newif\if@noSectionSlide
\@noSectionSlidefalse
\DeclareOptionBeamer{nosectionslide}{
\@noSectionSlidetrue
}
% Option: protectframetitle
% applies \protect to \insertframetitle to allow \cite, \ref, etc.
\newif\if@protectFrameTitle
\@protectFrameTitlefalse
\DeclareOptionBeamer{protectframetitle}{
\@protectFrameTitletrue
}
% Option: nooffset
% turns off extra space used to vertically center content on frames
\newlength{\@mtheme@voffset} \newlength{\@mtheme@voffset}
\setlength{\@mtheme@voffset}{2em} \setlength{\@mtheme@voffset}{2em}
\DeclareOptionBeamer{nooffset}{
\setlength{\@mtheme@voffset}{0em}
}
\DeclareOptionBeamer{usetitleprogressbar}{\@useTitleProgressBartrue} % Option: blockbg
\DeclareOptionBeamer{protectframetitle}{\@protectFrameTitletrue} % applies a gray background to blocks (via color theme `metropolis`)
\DeclareOptionBeamer{blockbg}{%
\DeclareOptionBeamer{blockbg}{
\PassOptionsToPackage{blockbg}{beamercolorthememetropolis}% \PassOptionsToPackage{blockbg}{beamercolorthememetropolis}%
} }
\DeclareOptionBeamer{nooffset}{\setlength{\@mtheme@voffset}{0em}}
\DeclareOptionBeamer*{% % Option: ...
\DeclareOptionBeamer*{
\PackageWarning{beamerthemem}{Unknown option `\CurrentOption'}% \PackageWarning{beamerthemem}{Unknown option `\CurrentOption'}%
} }
\DeclareOptionBeamer{nosectionslide}{\@noSectionSlidetrue}
\DeclareOptionBeamer{usetotalslideindicator}{\@useTotalSlideIndicatortrue}
\DeclareOptionBeamer{noslidenumbers}{\@noSlideNumberstrue}
\ProcessOptionsBeamer \ProcessOptionsBeamer
%}}} % Customize: \mthemetitleformat
% formats the main title, section titles, and frame titles
\def\mthemetitleformat#1{\scshape #1}
\mode<presentation> \mode<presentation>
@ -176,8 +225,6 @@
\newcommand{\insertsectionHEADaux}[3]{\mthemetitleformat{#3}}% \newcommand{\insertsectionHEADaux}[3]{\mthemetitleformat{#3}}%
\def\mthemetitleformat#1{\scshape #1}
\newcommand{\plain}[2][]{% \newcommand{\plain}[2][]{%
\begingroup \begingroup
\setbeamercolor{background canvas}{use=palette primary,bg=palette primary.fg} \setbeamercolor{background canvas}{use=palette primary,bg=palette primary.fg}