From eee786051867a28227882b4afc8c0fe025d86259 Mon Sep 17 00:00:00 2001 From: Ross Churchley Date: Sat, 6 Feb 2016 19:24:47 -0800 Subject: [PATCH] Standardize internal command namespacing Use \metropolis@foo instead of \@metropolis@foo, following the example of`beamer`'s source code --- source/beamercolorthememetropolis.dtx | 22 +++--- source/beamerinnerthememetropolis.dtx | 100 +++++++++++++------------- source/beamerouterthememetropolis.dtx | 32 ++++----- source/beamerthememetropolis.dtx | 21 +++--- 4 files changed, 85 insertions(+), 90 deletions(-) diff --git a/source/beamercolorthememetropolis.dtx b/source/beamercolorthememetropolis.dtx index 4098c81..9d738d5 100644 --- a/source/beamercolorthememetropolis.dtx +++ b/source/beamercolorthememetropolis.dtx @@ -44,8 +44,8 @@ \pgfkeys{ /metropolis/color/block/.cd, .is choice, - transparent/.code=\@metropolis@block@transparent, - fill/.code=\@metropolis@block@fill, + transparent/.code=\metropolis@block@transparent, + fill/.code=\metropolis@block@fill, } % \end{macrocode} % \end{macro} @@ -57,16 +57,16 @@ \pgfkeys{ /metropolis/color/background/.cd, .is choice, - dark/.code=\@metropolis@colors@dark, - light/.code=\@metropolis@colors@light, + dark/.code=\metropolis@colors@dark, + light/.code=\metropolis@colors@light, } % \end{macrocode} % \end{macro} % -% \begin{macro}{\@metropolis@color@setdefaults} +% \begin{macro}{\metropolis@color@setdefaults} % Set default values for color theme options. % \begin{macrocode} -\newcommand{\@metropolis@color@setdefaults}{ +\newcommand{\metropolis@color@setdefaults}{ \pgfkeys{/metropolis/color/.cd, background=light, block=transparent, @@ -94,13 +94,13 @@ % |alerted text|, and |example text|. % % \begin{macrocode} -\newcommand{\@metropolis@colors@dark}{ +\newcommand{\metropolis@colors@dark}{ \setbeamercolor{normal text}{% fg=black!2, bg=mDarkTeal } } -\newcommand{\@metropolis@colors@light}{ +\newcommand{\metropolis@colors@light}{ \setbeamercolor{normal text}{% fg=mDarkTeal, bg=black!2 @@ -177,10 +177,10 @@ % Blocks % % \begin{macrocode} -\newcommand{\@metropolis@block@transparent}{ +\newcommand{\metropolis@block@transparent}{ \setbeamercolor{block title}{use=normal text, parent=normal text} } -\newcommand{\@metropolis@block@fill}{ +\newcommand{\metropolis@block@fill}{ \setbeamercolor{block title}{% use=normal text, fg=normal text.fg, @@ -215,7 +215,7 @@ % Process package options % % \begin{macrocode} -\@metropolis@color@setdefaults +\metropolis@color@setdefaults \ProcessPgfPackageOptions{/metropolis/color} % \end{macrocode} % diff --git a/source/beamerinnerthememetropolis.dtx b/source/beamerinnerthememetropolis.dtx index a62da00..7fb86cd 100644 --- a/source/beamerinnerthememetropolis.dtx +++ b/source/beamerinnerthememetropolis.dtx @@ -58,8 +58,8 @@ \pgfkeys{ /metropolis/inner/block/.cd, .is choice, - transparent/.code=\setlength{\@metropolis@blockskip}{0ex}, - fill/.code=\setlength{\@metropolis@blockskip}{1ex}, + transparent/.code=\setlength{\metropolis@blockskip}{0ex}, + fill/.code=\setlength{\metropolis@blockskip}{1ex}, } % \end{macrocode} % \end{macro} @@ -71,22 +71,22 @@ /metropolis/inner/titleformat title/.cd, .is choice, regular/.code={% - \let\@metropolis@titleformat\@empty% + \let\metropolis@titleformat\@empty% \setbeamerfont{title}{shape=\normalfont}% }, smallcaps/.code={% - \let\@metropolis@titleformat\@empty% + \let\metropolis@titleformat\@empty% \setbeamerfont{title}{shape=\scshape}% }, allsmallcaps/.code={% - \let\@metropolis@titleformat\MakeLowercase% + \let\metropolis@titleformat\MakeLowercase% \setbeamerfont{title}{shape=\scshape}% \PackageWarning{beamerthememetropolis}{% Be aware that titleformat title=allsmallcaps can lead to problems% } }, allcaps/.code={% - \let\@metropolis@titleformat\MakeUppercase% + \let\metropolis@titleformat\MakeUppercase% \setbeamerfont{title}{shape=\normalfont} \PackageWarning{beamerthememetropolis}{% Be aware that titleformat title=allcaps can lead to problems% @@ -103,22 +103,22 @@ /metropolis/inner/titleformat subtitle/.cd, .is choice, regular/.code={% - \let\@metropolis@subtitleformat\@empty% + \let\metropolis@subtitleformat\@empty% \setbeamerfont{subtitle}{shape=\normalfont}% }, smallcaps/.code={% - \let\@metropolis@subtitleformat\@empty% + \let\metropolis@subtitleformat\@empty% \setbeamerfont{subtitle}{shape=\scshape}% }, allsmallcaps/.code={% - \let\@metropolis@subtitleformat\MakeLowercase% + \let\metropolis@subtitleformat\MakeLowercase% \setbeamerfont{subtitle}{shape=\scshape}% \PackageWarning{beamerthememetropolis}{% Be aware that titleformat subtitle=allsmallcaps can lead to problems% } }, allcaps/.code={% - \let\@metropolis@subtitleformat\MakeUppercase% + \let\metropolis@subtitleformat\MakeUppercase% \setbeamerfont{subtitle}{shape=\normalfont}% \PackageWarning{beamerthememetropolis}{% Be aware that titleformat subtitle=allcaps can lead to problems% @@ -135,22 +135,22 @@ /metropolis/inner/titleformat section/.cd, .is choice, regular/.code={% - \let\@metropolis@sectiontitleformat\@empty% + \let\metropolis@sectiontitleformat\@empty% \setbeamerfont{section title}{shape=\normalfont}% }, smallcaps/.code={% - \let\@metropolis@sectiontitleformat\@empty% + \let\metropolis@sectiontitleformat\@empty% \setbeamerfont{section title}{shape=\scshape}% }, allsmallcaps/.code={% - \let\@metropolis@sectiontitleformat\MakeLowercase% + \let\metropolis@sectiontitleformat\MakeLowercase% \setbeamerfont{section title}{shape=\scshape}% \PackageWarning{beamerthememetropolis}{% Be aware that titleformat section=allsmallcaps can lead to problems% } }, allcaps/.code={% - \let\@metropolis@sectiontitleformat\MakeUppercase% + \let\metropolis@sectiontitleformat\MakeUppercase% \setbeamerfont{section title}{shape=\normalfont}% \PackageWarning{beamerthememetropolis}{% Be aware that titleformat section=allcaps can lead to problems% @@ -166,17 +166,17 @@ \pgfkeys{ /metropolis/inner/sectionpage/.cd, .is choice, - none/.code=\@metropolis@sectionpage@none, - simple/.code=\@metropolis@sectionpage@simple, - progressbar/.code=\@metropolis@sectionpage@progressbar, + none/.code=\metropolis@sectionpage@none, + simple/.code=\metropolis@sectionpage@simple, + progressbar/.code=\metropolis@sectionpage@progressbar, } % \end{macrocode} % \end{macro} % -% \begin{macro}{\@metropolis@inner@setdefaults} +% \begin{macro}{\metropolis@inner@setdefaults} % Set default values for inner theme options. % \begin{macrocode} -\newcommand{\@metropolis@inner@setdefaults}{ +\newcommand{\metropolis@inner@setdefaults}{ \pgfkeys{/metropolis/inner/.cd, sectionpage=progressbar, block=transparent, @@ -192,12 +192,12 @@ % % \subsubsection{Title page} % -% \begin{macro}{\@metropolis@titleformat} +% \begin{macro}{\metropolis@titleformat} % Define hooks to change the case format of the titles. % \begin{macrocode} -\def\@metropolis@titleformat#1{#1} -\def\@metropolis@subtitleformat#1{#1} -\def\@metropolis@sectiontitleformat#1{#1} +\def\metropolis@titleformat#1{#1} +\def\metropolis@subtitleformat#1{#1} +\def\metropolis@sectiontitleformat#1{#1} % \end{macrocode} % \end{macro} % @@ -210,13 +210,13 @@ % \begin{macrocode} \patchcmd{\sectionentry} {\def\insertsectionhead{#2}} - {\def\insertsectionhead{\@metropolis@sectiontitleformat{#2}}} + {\def\insertsectionhead{\metropolis@sectiontitleformat{#2}}} {} {\PackageError{beamerinnerthememetropolis}{Patching section title failed}} \patchcmd{\beamer@section} {\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}} {\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{% - \@metropolis@sectiontitleformat{#1}}}} + \metropolis@sectiontitleformat{#1}}}} {} {\PackageError{beamerinnerthememetropolis}{Patching section title failed}} % \end{macrocode} @@ -298,7 +298,7 @@ \setbeamertemplate{title}{ \raggedright% \linespread{1.0}% - \@metropolis@titleformat{\inserttitle}% + \metropolis@titleformat{\inserttitle}% \par% \vspace*{0.5em} } @@ -309,7 +309,7 @@ % Set the subtitle on the title page. % \begin{macrocode} \setbeamertemplate{subtitle}{ - \@metropolis@subtitleformat{\insertsubtitle}% + \metropolis@subtitleformat{\insertsubtitle}% \par% \vspace*{0.5em} } @@ -371,7 +371,7 @@ % Template for the section title slide at the beginning of each section. % % \begin{macrocode} -\newcommand{\@metropolis@sectionpage@none}{ +\newcommand{\metropolis@sectionpage@none}{ \AtBeginSection{ % intenionally empty } @@ -382,7 +382,7 @@ \usebeamerfont{section title} \insertsectionhead\\ } -\newcommand{\@metropolis@sectionpage@simple}{ +\newcommand{\metropolis@sectionpage@simple}{ \setbeamertemplate{section page}[simple] \AtBeginSection{ \ifbeamer@inframe @@ -402,7 +402,7 @@ \end{minipage} \par } -\newcommand{\@metropolis@sectionpage@progressbar}{ +\newcommand{\metropolis@sectionpage@progressbar}{ \setbeamertemplate{section page}[progressbar] \AtBeginSection{ \ifbeamer@inframe @@ -456,23 +456,23 @@ % Regular block environment % % \begin{macrocode} -\newlength{\@metropolis@blockskip} +\newlength{\metropolis@blockskip} \setbeamertemplate{block begin}{% - \setlength{\parskip}{\@metropolis@parskip} + \setlength{\parskip}{\metropolis@parskip} \vspace*{1ex} \begin{beamercolorbox}[% ht=2.4ex, dp=1ex, - leftskip=\@metropolis@blockskip, - rightskip=\@metropolis@blockskip]{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=\@metropolis@blockskip, - rightskip=\@metropolis@blockskip, + leftskip=\metropolis@blockskip, + rightskip=\metropolis@blockskip, vmode]{block body}% } \setbeamertemplate{block end}{% @@ -485,21 +485,21 @@ % % \begin{macrocode} \setbeamertemplate{block alerted begin}{% - \setlength{\parskip}{\@metropolis@parskip} + \setlength{\parskip}{\metropolis@parskip} \vspace*{1ex} \begin{beamercolorbox}[% ht=2.4ex, dp=1ex, - leftskip=\@metropolis@blockskip, - rightskip=\@metropolis@blockskip]{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=\@metropolis@blockskip, - rightskip=\@metropolis@blockskip, + leftskip=\metropolis@blockskip, + rightskip=\metropolis@blockskip, vmode]{block body alerted}% } \setbeamertemplate{block alerted end}{% @@ -512,21 +512,21 @@ % % \begin{macrocode} \setbeamertemplate{block example begin}{% - \setlength{\parskip}{\@metropolis@parskip} + \setlength{\parskip}{\metropolis@parskip} \vspace*{1ex} \begin{beamercolorbox}[% ht=2.4ex, dp=1ex, - leftskip=\@metropolis@blockskip, - rightskip=\@metropolis@blockskip]{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=\@metropolis@blockskip, - rightskip=\@metropolis@blockskip, + leftskip=\metropolis@blockskip, + rightskip=\metropolis@blockskip, vmode]{block body example}% } \setbeamertemplate{block example end}{% @@ -561,9 +561,9 @@ % \subsubsection{Text and spacing settings} % % \begin{macrocode} -\newlength{\@metropolis@parskip} -\setlength{\@metropolis@parskip}{0.5em} -\setlength{\parskip}{\@metropolis@parskip} +\newlength{\metropolis@parskip} +\setlength{\metropolis@parskip}{0.5em} +\setlength{\parskip}{\metropolis@parskip} \linespread{1.15} % \end{macrocode} % @@ -587,7 +587,7 @@ % Process package options % % \begin{macrocode} -\@metropolis@inner@setdefaults +\metropolis@inner@setdefaults \ProcessPgfPackageOptions{/metropolis/inner} % \end{macrocode} % diff --git a/source/beamerouterthememetropolis.dtx b/source/beamerouterthememetropolis.dtx index 1746a30..2f54340 100644 --- a/source/beamerouterthememetropolis.dtx +++ b/source/beamerouterthememetropolis.dtx @@ -93,23 +93,23 @@ /metropolis/outer/titleformat frame/.cd, .is choice, regular/.code={% - \let\@metropolis@frametitleformat\@empty% + \let\metropolis@frametitleformat\@empty% \setbeamerfont{frametitle}{shape=\normalfont}% - \renewcommand{\@metropolis@frametitlestrut}{% + \renewcommand{\metropolis@frametitlestrut}{% \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}% } }, smallcaps/.code={% - \let\@metropolis@frametitleformat\@empty% + \let\metropolis@frametitleformat\@empty% \setbeamerfont{frametitle}{shape=\scshape}% - \renewcommand{\@metropolis@frametitlestrut}{% + \renewcommand{\metropolis@frametitlestrut}{% \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}% } }, allsmallcaps/.code={% - \let\@metropolis@frametitleformat\MakeLowercase% + \let\metropolis@frametitleformat\MakeLowercase% \setbeamerfont{frametitle}{shape=\scshape}% - \renewcommand{\@metropolis@frametitlestrut}{% + \renewcommand{\metropolis@frametitlestrut}{% \vphantom{abcdefghijklmnopqrstuvwxyz}% } \PackageWarning{beamerthememetropolis}{% @@ -117,9 +117,9 @@ } }, allcaps/.code={% - \let\@metropolis@frametitleformat\MakeUppercase% + \let\metropolis@frametitleformat\MakeUppercase% \setbeamerfont{frametitle}{shape=\normalfont} - \renewcommand{\@metropolis@frametitlestrut}{% + \renewcommand{\metropolis@frametitlestrut}{% \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZ}% } \PackageWarning{beamerthememetropolis}{% @@ -130,10 +130,10 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\@metropolis@outer@setdefaults} +% \begin{macro}{\metropolis@outer@setdefaults} % Set default values for outer theme options. % \begin{macrocode} -\newcommand{\@metropolis@outer@setdefaults}{ +\newcommand{\metropolis@outer@setdefaults}{ \pgfkeys{/metropolis/outer/.cd, numbering=counter, progressbar=none, @@ -180,10 +180,10 @@ % % \subsubsection{Frametitle} % -% \begin{macro}{\@metropolis@frametitleformat} +% \begin{macro}{\metropolis@frametitleformat} % Define a hook to change the case format of the frame title. % \begin{macrocode} -\def\@metropolis@frametitleformat#1{#1} +\def\metropolis@frametitleformat#1{#1} % \end{macrocode} % \end{macro} % @@ -202,7 +202,7 @@ \gdef\beamer@shortframetitle{#1}% }} {\beamer@ifempty{#2}{}{% - \gdef\insertframetitle{{\@metropolis@frametitleformat{#2}\ifnum% + \gdef\insertframetitle{{\metropolis@frametitleformat{#2}\ifnum% \beamer@autobreakcount>0\relax{}\space% \usebeamertemplate*{frametitle continuation}\fi}}% \gdef\beamer@frametitle{#2}% @@ -218,14 +218,14 @@ % progress bar. % % \begin{macrocode} -\newlength{\@metropolis@frametitlestrut} +\newlength{\metropolis@frametitlestrut} \defbeamertemplate{frametitle}{plain}{% \nointerlineskip% \begin{beamercolorbox}[% wd=\paperwidth,% sep=1.5ex,% ]{frametitle}% - \@metropolis@frametitlestrut\insertframetitle\@metropolis@frametitlestrut% + \metropolis@frametitlestrut\insertframetitle\metropolis@frametitlestrut% \end{beamercolorbox}% } % \end{macrocode} @@ -257,7 +257,7 @@ % Process package options % % \begin{macrocode} -\@metropolis@outer@setdefaults +\metropolis@outer@setdefaults \ProcessPgfPackageOptions{/metropolis/outer} % \end{macrocode} % diff --git a/source/beamerthememetropolis.dtx b/source/beamerthememetropolis.dtx index 17bd88c..56bf1ab 100644 --- a/source/beamerthememetropolis.dtx +++ b/source/beamerthememetropolis.dtx @@ -76,22 +76,22 @@ /metropolis/titleformat plain/.cd, .is choice, regular/.code={% - \let\@metropolis@plaintitleformat\@empty% + \let\metropolis@plaintitleformat\@empty% \setbeamerfont{plain title}{shape=\normalfont}% }, smallcaps/.code={% - \let\@metropolis@plaintitleformat\@empty% + \let\metropolis@plaintitleformat\@empty% \setbeamerfont{plain title}{shape=\scshape}% }, allsmallcaps/.code={% - \let\@metropolis@plaintitleformat\MakeLowercase% + \let\metropolis@plaintitleformat\MakeLowercase% \setbeamerfont{plain title}{shape=\scshape}% \PackageWarning{beamerthememetropolis}{% Be aware that titleformat plain=allsmallcaps can lead to problems% } }, allcaps/.code={% - \let\@metropolis@plaintitleformat\MakeUppercase% + \let\metropolis@plaintitleformat\MakeUppercase% \setbeamerfont{plain title}{shape=\normalfont}% \PackageWarning{beamerthememetropolis}{% Be aware that titleformat plain=allcaps can lead to problems% @@ -133,7 +133,7 @@ % Set default values for options. % % \begin{macrocode} -\newcommand{\@metropolis@setdefaults}{ +\newcommand{\metropolis@setdefaults}{ \pgfkeys{/metropolis/.cd, titleformat plain=regular, } @@ -170,17 +170,12 @@ % We define custom commands in this package as their proper usage may depend % on multiple sub-packages. % -% \begin{macro}{\@metropolis@plaintitleformat} -% Define a hook to change the case format of the plain title. -% \begin{macrocode} -\def\@metropolis@plaintitleformat#1{#1} -% \end{macrocode} -% \end{macro} % % \begin{macro}{\plain} % Creates a plain frame with dark background, suitable for displaying images % or a few words. % \begin{macrocode} +\def\metropolis@plaintitleformat#1{#1} \newcommand{\plain}[2][]{% \begingroup \setbeamercolor{background canvas}{ @@ -191,7 +186,7 @@ \begin{center} \usebeamercolor[fg]{palette primary} \usebeamerfont{plain title} - \@metropolis@plaintitleformat{#2} + \metropolis@plaintitleformat{#2} \end{center} \end{frame} \endgroup @@ -208,7 +203,7 @@ % Process package options % % \begin{macrocode} -\@metropolis@setdefaults +\metropolis@setdefaults \ProcessPgfOptions{/metropolis} % \end{macrocode} %