diff options
author | Karl Berry <karl@freefriends.org> | 2016-03-14 21:25:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-03-14 21:25:03 +0000 |
commit | 1cdee1080e0ad8f88624629e00039d9fe89c1b54 (patch) | |
tree | de1ea75b810891ce5bc773022516edfab072ac77 /Master/texmf-dist/source/latex/beamertheme-metropolis | |
parent | ecc285a4a14716fefbfab61485038eb34dd32a5e (diff) |
beamertheme-metropolis (14mar16)
git-svn-id: svn://tug.org/texlive/trunk@40024 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/beamertheme-metropolis')
7 files changed, 934 insertions, 632 deletions
diff --git a/Master/texmf-dist/source/latex/beamertheme-metropolis/beamercolorthememetropolis.dtx b/Master/texmf-dist/source/latex/beamertheme-metropolis/beamercolorthememetropolis.dtx index 1d5f50e2534..90ba7ef0459 100644 --- a/Master/texmf-dist/source/latex/beamertheme-metropolis/beamercolorthememetropolis.dtx +++ b/Master/texmf-dist/source/latex/beamertheme-metropolis/beamercolorthememetropolis.dtx @@ -10,16 +10,10 @@ % International License (https://creativecommons.org/licenses/by-sa/4.0/). % ------------------------------------------------------------------------- \fi % \iffalse -%<driver> \ProvidesFile{beamercolorthememetropolis.dtx} %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamercolorthememetropolis}[2015/12/04 Metropolis color theme] +\ProvidesPackage{beamercolorthememetropolis}[2016/03/14 Metropolis color theme] %</package> -%<driver> \documentclass{ltxdoc} -%<driver> \usepackage{beamercolorthememetropolis} -%<driver> \begin{document} -%<driver> \DocInput{beamercolorthememetropolis.dtx} -%<driver> \end{document} % \fi % \CheckSum{0} % \StopEventually{} @@ -27,9 +21,11 @@ %<*package> % ------------------------------------------------------------------------- \fi % -% \subsection{\textsc{metropolis} color theme} +% \subsection{\themename color theme} % -% Load required packages. +% +% +% \subsubsection{Package dependencies} % \begin{macrocode} \RequirePackage{pgfopts} % \end{macrocode} @@ -39,34 +35,35 @@ % \subsubsection{Options} % % \begin{macro}{block} -% This option controls whether the blocks are filled or transparent. +% Optionally adds a light grey background to block environments like +% |theorem| and |example|. % \begin{macrocode} \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} % % \begin{macro}{colors} -% Defines whether the background shall be dark and the foreground be light or -% vice versa +% Provides the option to have a dark background and light foreground instead +% of the reverse. % \begin{macrocode} \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} -% Set default values for color theme options. +% \begin{macro}{\metropolis@color@setdefaults} +% Sets default values for color theme options. % \begin{macrocode} -\newcommand{\@metropolis@color@setdefaults}{ +\newcommand{\metropolis@color@setdefaults}{ \pgfkeys{/metropolis/color/.cd, background=light, block=transparent, @@ -90,17 +87,17 @@ % % \subsubsection{Base styles} % -% All colors in the \textsc{metropolis} theme are derived from the definitions -% of |normal text|, |alerted text|, and |example text|. +% All colors in \themename are derived from the definitions of |normal text|, +% |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 @@ -133,8 +130,8 @@ % \end{macrocode} % % The “primary” palette should be used for the most important navigational -% elements, and possibly of other elements. The \textsc{metropolis} theme uses -% it for frame titles and slides. +% elements, and possibly of other elements. \themename uses it for frame +% titles and slides. % % \begin{macrocode} \setbeamercolor{palette primary}{% @@ -148,7 +145,7 @@ } % \end{macrocode} % -% The \textsc{metropolis} inner or outer themes optionally display progress +% The \themename 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 @@ -174,18 +171,33 @@ } % \end{macrocode} % -% Blocks +% Block environments such as |theorem| and |example| have no background color +% by default. The option |block=fill| sets a background color based on the +% background and foreground of |normal text|. The option |block=transparent| +% reverts the block environments to an empty background, which can be useful +% if changing colors mid-presentation. % % \begin{macrocode} -\newcommand{\@metropolis@block@transparent}{ - \setbeamercolor{block title}{use=normal text, parent=normal text} +\newcommand{\metropolis@block@transparent}{ + \setbeamercolor{block title}{% + use=normal text, + fg=normal text.fg, + bg= + } + \setbeamercolor{block body}{ + bg= + } } -\newcommand{\@metropolis@block@fill}{ +\newcommand{\metropolis@block@fill}{ \setbeamercolor{block title}{% use=normal text, fg=normal text.fg, bg=normal text.bg!80!fg } + \setbeamercolor{block body}{ + use={block title, normal text}, + bg=block title.bg!50!normal text.bg + } } \setbeamercolor{block title alerted}{% use={block title, alerted text}, @@ -199,10 +211,6 @@ } \setbeamercolor{block body alerted}{use=block body, parent=block body} \setbeamercolor{block body example}{use=block body, parent=block body} -\setbeamercolor{block body}{ - use={block title, normal text}, - bg=block title.bg!50!normal text.bg -} % \end{macrocode} % % Footnotes @@ -212,10 +220,12 @@ \setbeamercolor{footnote mark}{fg=.} % \end{macrocode} % -% Process package options +% +% +% \subsubsection{Process package options} % % \begin{macrocode} -\@metropolis@color@setdefaults +\metropolis@color@setdefaults \ProcessPgfPackageOptions{/metropolis/color} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerfontthememetropolis.dtx b/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerfontthememetropolis.dtx index 4c9b4516bd3..0d707d5053a 100644 --- a/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerfontthememetropolis.dtx +++ b/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerfontthememetropolis.dtx @@ -10,45 +10,46 @@ % International License (https://creativecommons.org/licenses/by-sa/4.0/). % ------------------------------------------------------------------------- \fi % \iffalse -%<driver> \ProvidesFile{beamerfontthememetropolis.dtx} %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerfontthememetropolis}[2015/12/04 Metropolis font theme] +\ProvidesPackage{beamerfontthememetropolis}[2016/03/14 Metropolis font theme] %</package> -%<driver> \documentclass{ltxdoc} -%<driver> \usepackage{beamerfontthememetropolis} -%<driver> \begin{document} -%<driver> \DocInput{beamerfontthememetropolis.dtx} -%<driver> \end{document} % \fi % \CheckSum{0} % \StopEventually{} % \iffalse %<*package> % ------------------------------------------------------------------------- \fi -% \subsection{\textsc{metropolis} font theme} % +% \subsection{\themename font theme} +% +% A |beamer| font theme sets the style of the font used in the document. +% +% +% +% \subsubsection{Package dependencies} % -% Load required packages. % \begin{macrocode} \RequirePackage{etoolbox} \RequirePackage{ifxetex} \RequirePackage{ifluatex} +\RequirePackage{pgfopts} % \end{macrocode} % -% \subsubsection{Load Fira font} -% If the presentation is compiled with XeLaTeX or LuaLaTeX the fontspec package -% will be loaded. +% +% +% \subsubsection{Load Fira fonts} +% +% If the presentation is compiled with Xe\LaTeX{} or Lua\LaTeX{}, the fontspec +% package is loaded and we search for the |Fira| fonts. +% % \begin{macrocode} \ifboolexpr{bool {xetex} or bool {luatex}}{ \RequirePackage[no-math]{fontspec} % \end{macrocode} % -% To simplify the check whether the |Fira| fonts are installed, a set macros is -% defined. -% % \begin{macro}{\checkfont} -% Checks if a font is installed and increases |fontsnotfound| counter if not. +% Checks if a font is installed; if not, |fontsnotfound| is increased. % \begin{macrocode} \newcounter{fontsnotfound} \newcommand{\checkfont}[1]{% @@ -64,11 +65,11 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\iffontexists} -% Resets the |fontsnotfound| counter and calls |\checkfont| for each font in -% the comma separated list in the first argument. +% \begin{macro}{\iffontsavailable} +% Resets the |fontsnotfound| counter and calls |\checkfont| for each font in +% the comma separated list in the first argument. % \begin{macrocode} - \newcommand{\iffontsexist}[3]{% + \newcommand{\iffontsavailable}[3]{% \setcounter{fontsnotfound}{0}% \expandafter\forcsvlist\expandafter% \checkfont\expandafter{#1}% @@ -81,34 +82,42 @@ % \end{macrocode} % \end{macro} % -% Using the previously defined macros it is tried to load the |Fira| fonts. -% First the default |Fira| name will be tried. Second the |Fira| fonts with -% the suffix OT -- used by some Linux distributions -- will be tried. If this -% also fails a warning will be displayed and the standard fonts will be used. +% We search for regular, italic, light, light italic, mono, and mono bold +% fonts under the default |Fira Sans| and |Fira Mono| names. If this fails, +% the suffix OT --- used by some Linux distributions --- will be tried. If this +% also fails, a warning will be displayed and the standard fonts will be used. % % \begin{macrocode} - \iffontsexist{Fira Sans Light,% - Fira Sans Light Italic,% - Fira Sans,% - Fira Sans Italic}{% - \setsansfont[BoldFont={Fira Sans}]{Fira Sans Light}% + \iffontsavailable{Fira Sans Light,% + Fira Sans Light Italic,% + Fira Sans,% + Fira Sans Italic}% + {% + \setsansfont[ItalicFont={Fira Sans Light Italic},% + BoldFont={Fira Sans},% + BoldItalicFont={Fira Sans Italic}]% + {Fira Sans Light}% }{% - \iffontsexist{Fira Sans Light OT,% - Fira Sans Light Italic OT,% - Fira Sans OT,% - Fira Sans Italic OT}{% - \setsansfont[BoldFont={Fira Sans OT}]{Fira Sans Light OT}% + \iffontsavailable{Fira Sans Light OT,% + Fira Sans Light Italic OT,% + Fira Sans OT,% + Fira Sans Italic OT}% + {% + \setsansfont[ItalicFont={Fira Sans Light Italic OT},% + BoldFont={Fira Sans OT},% + BoldItalicFont={Fira Sans Italic OT}]% + {Fira Sans Light OT}% }{% \PackageWarning{beamerthememetropolis}{% Could not find Fira Sans fonts% } } } - \iffontsexist{Fira Mono, Fira Mono Bold}{% - \setmonofont{Fira Mono}% + \iffontsavailable{Fira Mono, Fira Mono Bold}{% + \setmonofont[BoldFont={Fira Mono Medium}]{Fira Mono}% }{% - \iffontsexist{Fira Mono OT, Fira Mono Bold OT}{% - \setmonofont{Fira Mono OT}% + \iffontsavailable{Fira Mono OT, Fira Mono Bold OT}{% + \setmonofont[BoldFont={Fira Mono Medium OT}]{Fira Mono OT}% }{% \PackageWarning{beamerthememetropolis}{% Could not find Fira Mono fonts% @@ -125,6 +134,10 @@ } % \end{macrocode} % +% This concludes the portion of the code which is only run when compiled with +% Xe\LaTeX{} or Lua\LaTeX{}. The remainder of this package applies regardless +% of the compiling engine. +% % % % \subsubsection{General font definitions} @@ -136,8 +149,6 @@ \setbeamerfont{date}{size=\small} \setbeamerfont{section title}{size=\Large,% series=\bfseries} -\setbeamerfont{plain title}{size=\Large,% - series=\bfseries} \setbeamerfont{block title}{size=\normalsize,% series=\bfseries} \setbeamerfont{block title alerted}{size=\normalsize,% @@ -157,8 +168,239 @@ series=\normalfont} \setbeamerfont{bibliography entry note}{size=\small,% series=\normalfont} +\setbeamerfont{standout}{size=\Large,% + series=\bfseries} +% \end{macrocode} +% +% +% +% \subsubsection{Title format options} +% +% \begin{macro}{titleformat title} +% Controls the format of the title. +% \begin{macrocode} +\pgfkeys{ + /metropolis/font/titleformat title/.cd, + .is choice, + regular/.code={% + \let\metropolis@titleformat\@empty% + \setbeamerfont{title}{shape=\normalfont}% + }, + smallcaps/.code={% + \let\metropolis@titleformat\@empty% + \setbeamerfont{title}{shape=\scshape}% + }, + allsmallcaps/.code={% + \let\metropolis@titleformat\lowercase% + \setbeamerfont{title}{shape=\scshape}% + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat title=allsmallcaps can lead to problems% + } + }, + allcaps/.code={% + \let\metropolis@titleformat\uppercase% + \setbeamerfont{title}{shape=\normalfont} + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat title=allcaps can lead to problems% + } + }, +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{titleformat subtitle} +% Control the format of the subtitle. +% \begin{macrocode} +\pgfkeys{ + /metropolis/font/titleformat subtitle/.cd, + .is choice, + regular/.code={% + \let\metropolis@subtitleformat\@empty% + \setbeamerfont{subtitle}{shape=\normalfont}% + }, + smallcaps/.code={% + \let\metropolis@subtitleformat\@empty% + \setbeamerfont{subtitle}{shape=\scshape}% + }, + allsmallcaps/.code={% + \let\metropolis@subtitleformat\lowercase% + \setbeamerfont{subtitle}{shape=\scshape}% + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat subtitle=allsmallcaps can lead to problems% + } + }, + allcaps/.code={% + \let\metropolis@subtitleformat\uppercase% + \setbeamerfont{subtitle}{shape=\normalfont}% + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat subtitle=allcaps can lead to problems% + } + }, +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{titleformat section} +% Controls the format of the section title. +% \begin{macrocode} +\pgfkeys{ + /metropolis/font/titleformat section/.cd, + .is choice, + regular/.code={% + \let\metropolis@sectiontitleformat\@empty% + \setbeamerfont{section title}{shape=\normalfont}% + }, + smallcaps/.code={% + \let\metropolis@sectiontitleformat\@empty% + \setbeamerfont{section title}{shape=\scshape}% + }, + allsmallcaps/.code={% + \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% + \setbeamerfont{section title}{shape=\normalfont}% + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat section=allcaps can lead to problems% + } + }, +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{frametitleformat} +% Control the format of the frame title. +% \begin{macrocode} +\pgfkeys{ + /metropolis/font/titleformat frame/.cd, + .is choice, + regular/.code={% + \let\metropolis@frametitleformat\@empty% + \setbeamerfont{frametitle}{shape=\normalfont}% + }, + smallcaps/.code={% + \let\metropolis@frametitleformat\@empty% + \setbeamerfont{frametitle}{shape=\scshape}% + }, + allsmallcaps/.code={% + \let\metropolis@frametitleformat\MakeLowercase% + \setbeamerfont{frametitle}{shape=\scshape}% + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat frame=allsmallcaps can lead to problems% + } + }, + allcaps/.code={% + \let\metropolis@frametitleformat\MakeUppercase% + \setbeamerfont{frametitle}{shape=\normalfont} + \PackageWarning{beamerthememetropolis}{% + Be aware that titleformat frame=allcaps can lead to problems% + } + }, +} % \end{macrocode} +% \end{macro} +% +% \begin{macro}{titleformat aliases} +% Allows |titleformat title| et al. to be used in the |\usetheme| +% declaration, where \LaTeX{} automatically removes all spaces. +% \begin{macrocode} +\pgfkeys{ + /metropolis/font/.cd, + titleformattitle/.code=\pgfkeysalso{titleformat title=#1}, + titleformatsubtitle/.code=\pgfkeysalso{titleformat subtitle=#1}, + titleformatsection/.code=\pgfkeysalso{titleformat section=#1}, + titleformatframe/.code=\pgfkeysalso{titleformat frame=#1}, +} +% \end{macrocode} +% \end{macro} % +% \begin{macro}{\metropolis@font@setdefaults} +% Sets default values for font theme options. +% \begin{macrocode} +\newcommand{\metropolis@font@setdefaults}{ + \pgfkeys{/metropolis/font/.cd, + titleformat title=regular, + titleformat subtitle=regular, + titleformat section=regular, + titleformat frame=regular, + } +} +% \end{macrocode} +% \end{macro} +% +% We first 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@frametitleformat#1{#1} +% \end{macrocode} +% +% To make the uppercase and lowercase macros work in the title, subtitle, etc., +% we have to patch the appropriate |beamer| commands that set their values. +% This solution was suggested by Enrico Gregorio in an answer to +% \href{http://tex.stackexchange.com/questions/112526/}{this StackExchange +% question}. +% +% \begin{macrocode} +\patchcmd{\beamer@title}% + {\def\inserttitle{#2}}% + {\def\inserttitle{\metropolis@titleformat{#2}}}% + {}% + {\PackageError{beamerfontthememetropolis}{Patching title failed}} +\patchcmd{\beamer@subtitle}% + {\def\insertsubtitle{#2}}% + {\def\insertsubtitle{\metropolis@subtitleformat{#2}}}% + {}% + {\PackageError{beamerfontthememetropolis}{Patching subtitle failed}} +\patchcmd{\sectionentry} + {\def\insertsectionhead{#2}} + {\def\insertsectionhead{\metropolis@sectiontitleformat{#2}}} + {} + {\PackageError{beamerfontthememetropolis}{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}}}} + {} + {\PackageError{beamerfontthememetropolis}{Patching section title failed}} +% \end{macrocode} +% +% Similarly, to make the |\MakeLowercase| and |\MakeUppercase| macros work in +% the frame title we have to patch |\beamer@@frametitle|. +% +% \begin{macrocode} +\patchcmd{\beamer@@frametitle} + {\beamer@ifempty{#2}{}{% + \gdef\insertframetitle{{#2\ifnum\beamer@autobreakcount>0\relax{}\space% + \usebeamertemplate*{frametitle continuation}\fi}}% + \gdef\beamer@frametitle{#2}% + \gdef\beamer@shortframetitle{#1}% + }} + {\beamer@ifempty{#2}{}{% + \gdef\insertframetitle{{\metropolis@frametitleformat{#2}\ifnum% + \beamer@autobreakcount>0\relax{}\space% + \usebeamertemplate*{frametitle continuation}\fi}}% + \gdef\beamer@frametitle{#2}% + \gdef\beamer@shortframetitle{#1}% + }} + {} + {\PackageError{beamerfontthememetropolis}{Patching frame title failed}} +% \end{macrocode} +% +% +% +% \subsubsection{Process package options} +% +% \begin{macrocode} +\metropolis@font@setdefaults +\ProcessPgfPackageOptions{/metropolis/font} +% \end{macrocode} % \iffalse %</package> % \fi diff --git a/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerinnerthememetropolis.dtx b/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerinnerthememetropolis.dtx index 21daf14a7bc..89550ea3a07 100644 --- a/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerinnerthememetropolis.dtx +++ b/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerinnerthememetropolis.dtx @@ -10,16 +10,10 @@ % International License (https://creativecommons.org/licenses/by-sa/4.0/). % ------------------------------------------------------------------------- \fi % \iffalse -%<driver> \ProvidesFile{beamerinnerthememetropolis.dtx} %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerinnerthememetropolis}[2015/12/04 Metropolis inner theme] +\ProvidesPackage{beamerinnerthememetropolis}[2016/03/14 Metropolis inner theme] %</package> -%<driver> \documentclass{ltxdoc} -%<driver> \usepackage{beamerinnerthememetropolis} -%<driver> \begin{document} -%<driver> \DocInput{beamerinnerthememetropolis.dtx} -%<driver> \end{document} % \fi % \CheckSum{0} % \StopEventually{} @@ -27,7 +21,7 @@ %<*package> % ------------------------------------------------------------------------- \fi % -% \subsection{\textsc{metropolis} inner theme} +% \subsection{\themename inner theme} % % A |beamer| inner theme dictates the style of the frame elements traditionally % set in the ``body'' of each slide. These include: @@ -40,9 +34,13 @@ % \item footnotes and plain text. % \end{itemize} % -% Load required packages. +% +% +% \subsubsection{Package dependencies} +% % \begin{macrocode} \RequirePackage{etoolbox} +\RequirePackage{keyval} \RequirePackage{calc} \RequirePackage{pgfopts} \RequirePackage{tikz} @@ -52,137 +50,43 @@ % % \subsubsection{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}{titleformat title} -% Control the titleformat of the title -% \begin{macrocode} -\pgfkeys{ - /metropolis/inner/titleformat title/.cd, - .is choice, - regular/.code={% - \let\@metropolis@titleformat\@empty% - \setbeamerfont{title}{shape=\normalfont}% - }, - smallcaps/.code={% - \let\@metropolis@titleformat\@empty% - \setbeamerfont{title}{shape=\scshape}% - }, - allsmallcaps/.code={% - \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% - \setbeamerfont{title}{shape=\normalfont} - \PackageWarning{beamerthememetropolis}{% - Be aware that titleformat title=allcaps can lead to problems% - } - }, -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{titleformat subtitle} -% Control the titleformat of the subtitle -% \begin{macrocode} -\pgfkeys{ - /metropolis/inner/titleformat subtitle/.cd, - .is choice, - regular/.code={% - \let\@metropolis@subtitleformat\@empty% - \setbeamerfont{subtitle}{shape=\normalfont}% - }, - smallcaps/.code={% - \let\@metropolis@subtitleformat\@empty% - \setbeamerfont{subtitle}{shape=\scshape}% - }, - allsmallcaps/.code={% - \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% - \setbeamerfont{subtitle}{shape=\normalfont}% - \PackageWarning{beamerthememetropolis}{% - Be aware that titleformat subtitle=allcaps can lead to problems% - } - }, -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{titleformat section} -% Control the titleformat of the section title +% \begin{macro}{sectionpage} +% Optionally add a slide marking the beginning of each section. % \begin{macrocode} \pgfkeys{ - /metropolis/inner/titleformat section/.cd, + /metropolis/inner/sectionpage/.cd, .is choice, - regular/.code={% - \let\@metropolis@sectiontitleformat\@empty% - \setbeamerfont{section title}{shape=\normalfont}% - }, - smallcaps/.code={% - \let\@metropolis@sectiontitleformat\@empty% - \setbeamerfont{section title}{shape=\scshape}% - }, - allsmallcaps/.code={% - \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% - \setbeamerfont{section title}{shape=\normalfont}% - \PackageWarning{beamerthememetropolis}{% - Be aware that titleformat section=allcaps can lead to problems% - } - }, + none/.code=\metropolis@disablesectionpage, + simple/.code={\metropolis@enablesectionpage + \setbeamertemplate{section page}[simple]}, + progressbar/.code={\metropolis@enablesectionpage + \setbeamertemplate{section page}[progressbar]}, } % \end{macrocode} % \end{macro} % % \begin{macro}{sectionpage} -% The |sectionpage| option defines the behaviour of the sectionpage. +% Optionally add a slide marking the beginning of each subsection. % \begin{macrocode} \pgfkeys{ - /metropolis/inner/sectionpage/.cd, + /metropolis/inner/subsectionpage/.cd, .is choice, - none/.code=\@metropolis@sectionpage@none, - simple/.code=\@metropolis@sectionpage@simple, - progressbar/.code=\@metropolis@sectionpage@progressbar, + none/.code=\metropolis@disablesubsectionpage, + simple/.code={\metropolis@enablesubsectionpage + \setbeamertemplate{section page}[simple]}, + progressbar/.code={\metropolis@enablesubsectionpage + \setbeamertemplate{section page}[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, - titleformat title=regular, - titleformat subtitle=regular, - titleformat section=regular, + subsectionpage=none } } % \end{macrocode} @@ -192,35 +96,6 @@ % % \subsubsection{Title page} % -% \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} -% \end{macrocode} -% \end{macro} -% -% To make the |\MakeLowercase| and |\MakeUppercase| macros work in the -% sectiontitle we have to patch |\sectionentry| and |\beamer@section|. This -% solution was suggested by Enrico Gregorio in an answer to -% \href{http://tex.stackexchange.com/questions/112526/}{this StackExchange -% question}. -% -% \begin{macrocode} -\patchcmd{\sectionentry} - {\def\insertsectionhead{#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}}}} - {} - {\PackageError{beamerinnerthememetropolis}{Patching section title failed}} -% \end{macrocode} -% % \begin{macro}{title page} % Template for the title page. Each element is only typset if it is defined % by the user. If |\subtitle| is empty, for example, it won't leave a blank @@ -268,7 +143,7 @@ \ifbeamer@inframe \titlepage \else - \frame[plain]{\titlepage} + \frame[plain,noframenumbering]{\titlepage} \fi } \def\titlepage{% @@ -298,7 +173,7 @@ \setbeamertemplate{title}{ \raggedright% \linespread{1.0}% - \@metropolis@titleformat{\inserttitle}% + \inserttitle% \par% \vspace*{0.5em} } @@ -309,7 +184,7 @@ % Set the subtitle on the title page. % \begin{macrocode} \setbeamertemplate{subtitle}{ - \@metropolis@subtitleformat{\insertsubtitle}% + \insertsubtitle% \par% \vspace*{0.5em} } @@ -371,44 +246,73 @@ % Template for the section title slide at the beginning of each section. % % \begin{macrocode} -\newcommand{\@metropolis@sectionpage@none}{ - \AtBeginSection{ - % intenionally empty - } -} \defbeamertemplate{section page}{simple}{ - \centering - \usebeamercolor[fg]{section title} - \usebeamerfont{section title} - \insertsectionhead\\ -} -\newcommand{\@metropolis@sectionpage@simple}{ - \setbeamertemplate{section page}[simple] - \AtBeginSection{ - \ifbeamer@inframe - \sectionpage - \else - \frame[plain,c]{\sectionpage} + \begin{center} + \usebeamercolor[fg]{section title} + \usebeamerfont{section title} + \insertsectionhead\par + \ifx\insertsubsection\@empty\else + \usebeamercolor[fg]{subsection title} + \usebeamerfont{subsection title} + \insertsubsection \fi - } + \end{center} } \defbeamertemplate{section page}{progressbar}{ \centering \begin{minipage}{22em} + \raggedright \usebeamercolor[fg]{section title} \usebeamerfont{section title} \insertsectionhead\\[-1ex] \usebeamertemplate*{progress bar in section page} + \par + \ifx\insertsubsection\@empty\else% + \usebeamercolor[fg]{subsection title}% + \usebeamerfont{subsection title}% + \insertsubsection + \fi \end{minipage} \par + \vspace{\baselineskip} +} +\newcommand{\metropolis@disablesectionpage}{ + \AtBeginSection{ + % intentionally empty + } } -\newcommand{\@metropolis@sectionpage@progressbar}{ - \setbeamertemplate{section page}[progressbar] +\newcommand{\metropolis@enablesectionpage}{ \AtBeginSection{ \ifbeamer@inframe \sectionpage \else - \frame[plain,c]{\sectionpage} + \frame[plain,c,noframenumbering]{\sectionpage} + \fi + } +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{subsection page} +% +% Template for the subsection title slide that can optionally be added to +% at the beginning of each subsection. +% +% \begin{macrocode} +\setbeamertemplate{subsection page}{% + \usebeamertemplate*{section page} +} +\newcommand{\metropolis@disablesubsectionpage}{ + \AtBeginSubsection{ + % intentionally empty + } +} +\newcommand{\metropolis@enablesubsectionpage}{ + \AtBeginSubsection{ + \ifbeamer@inframe + \subsectionpage + \else + \frame[plain,c,noframenumbering]{\subsectionpage} \fi } } @@ -453,87 +357,113 @@ % % \subsubsection{Block environments} % -% Regular block environment +% +% \begin{macro}{block} +% \begin{macro}{block alerted} +% \begin{macro}{block example} +% +% The three different block environments differ only in their colours. +% Rather than repeat the essentially the same template three times, we use +% the auxiliary macro |\metropolis@block| to define all three templates. % % \begin{macrocode} -\newlength{\@metropolis@blockskip} -\setbeamertemplate{block begin}{% - \setlength{\parskip}{\@metropolis@parskip} - \vspace*{1ex} - \begin{beamercolorbox}[% - ht=2.4ex, - dp=1ex, - 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, - vmode]{block body}% -} -\setbeamertemplate{block end}{% - \end{beamercolorbox} - \vspace*{0.2ex} +\newlength{\metropolis@blocksep} +\newlength{\metropolis@blockadjust} +\setlength{\metropolis@blocksep}{0.75ex} +\setlength{\metropolis@blockadjust}{0.25ex} +\providecommand{\metropolis@strut}{% + \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()}% } +\newcommand{\metropolis@block}[1]{ + \par\vskip\medskipamount% + \setlength{\parskip}{0pt} % \end{macrocode} % -% Alerted block environment +% If a background color is defined for the block title or body, we need to +% add a little bit of padding to the corresponding box. Ideally, this would +% be accomplished by setting |colsep=0.75ex|, which is intended to add +% ``color separation space'' only when the box has a colored background. +% Unfortunately, |colsep| also adds this separation if the background color +% is inherited, even if the inherited color is actually empty. +% (The technical reason for this boils down to the fact that the |\ifx| +% directive does not expand macros.) +% +% To achieve the correct spacing for |alertblock|s and |exampleblock|s +% as well as for normal blocks, we have to begin the |beamercolorbox| +% differently based on whether |block title| has an empty background. +% +% If the |block title| background is empty, or the user has explicitly +% removed the background from (e.g.) |block title alerted|, we just need to +% set a rightskip for a nice ragged-right block title. % % \begin{macrocode} -\setbeamertemplate{block alerted begin}{% - \setlength{\parskip}{\@metropolis@parskip} - \vspace*{1ex} - \begin{beamercolorbox}[% - ht=2.4ex, - dp=1ex, - leftskip=\@metropolis@blockskip, - rightskip=\@metropolis@blockskip]{block title alerted} - \usebeamerfont*{block title alerted}\insertblocktitle% + \ifbeamercolorempty[bg]{block title#1}{% + \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}}{% + \ifbeamercolorempty[bg]{block title}{% + \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}% + }% +% \end{macrocode} +% +% Otherwise, if the |block title| has a background, we set the padding based +% on |\metropolis@blockskip|. However, we have to visually compensate for +% the |\metropolis@strut| added to the block title (see below) by +% subtracting |\metropolis@blockadjust| from the top and bottom padding. +% +% \begin{macrocode} + {% + \begin{beamercolorbox}[ + sep=\dimexpr\metropolis@blocksep-\metropolis@blockadjust\relax, + leftskip=\metropolis@blockadjust, + rightskip=\dimexpr\metropolis@blockadjust plus 4em\relax + ]{block title#1}% + }}% +% \end{macrocode} +% +% We can now set the contents of the |block title|. The zero-width but +% positive-height box |\metropolis@strut| ensures that the block title box +% has a consistent height, even if it lacks punctuation, ascenders, or +% descenders. +% +% \begin{macrocode} + \usebeamerfont*{block title#1}% + \metropolis@strut% + \insertblocktitle% + \metropolis@strut% \end{beamercolorbox}% - \vspace*{-1pt} - \usebeamerfont{block body alerted}% - \begin{beamercolorbox}[% - dp=1ex, - leftskip=\@metropolis@blockskip, - rightskip=\@metropolis@blockskip, - vmode]{block body alerted}% -} -\setbeamertemplate{block alerted end}{% - \end{beamercolorbox} - \vspace*{0.2ex} +% \end{macrocode} +% +% Next, we typeset the |block body|. This the code is similar to, but simpler +% than, the |block title| code since we don't need to adjust for any struts. +% +% \begin{macrocode} + \nointerlineskip% + \ifbeamercolorempty[bg]{block body#1}{% + \begin{beamercolorbox}[vmode]{block body#1}}{ + \ifbeamercolorempty[bg]{block body}{% + \begin{beamercolorbox}[vmode]{block body#1}% + }{% + \begin{beamercolorbox}[sep=\metropolis@blocksep, vmode]{block body#1}% + \vspace{-\metropolis@parskip} + }}% + \usebeamerfont{block body#1}% + \setlength{\parskip}{\metropolis@parskip}% } % \end{macrocode} % -% Example block environment +% This concludes the auxiliary macro |\metropolis@block|. Finally, +% we define the block beamer templates using this macro. % % \begin{macrocode} -\setbeamertemplate{block example begin}{% - \setlength{\parskip}{\@metropolis@parskip} - \vspace*{1ex} - \begin{beamercolorbox}[% - ht=2.4ex, - dp=1ex, - 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, - vmode]{block body example}% -} -\setbeamertemplate{block example end}{% - \end{beamercolorbox} - \vspace*{0.2ex} -} +\setbeamertemplate{block begin}{\metropolis@block{}} +\setbeamertemplate{block alerted begin}{\metropolis@block{ alerted}} +\setbeamertemplate{block example begin}{\metropolis@block{ example}} +\setbeamertemplate{block end}{\end{beamercolorbox}\vspace*{0.2ex}} +\setbeamertemplate{block alerted end}{\end{beamercolorbox}\vspace*{0.2ex}} +\setbeamertemplate{block example end}{\end{beamercolorbox}\vspace*{0.2ex}} % \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} % % % @@ -561,9 +491,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} % @@ -584,10 +514,66 @@ } % \end{macrocode} % -% Process package options +% +% +% \subsubsection{Standout frames} +% +% \themename offers a custom frame format with large, centered text and an +% inverted background. To use it, add the key |standout| to the frame: +% |\begin{frame}[standout] ... \end{frame}|. +% +% \begin{macro}{standout} +% +% Optional arguments to Beamer's frames are implemented using +% |\define@key| from the |keyval| package, which will execute code when the +% defined option is called. For the |standout| option, we begin a group, +% change the colors and fonts, and set a \centering alignment. +% +% \begin{macrocode} +\providebool{metropolis@standout} +\define@key{beamerframe}{standout}[true]{% + \booltrue{metropolis@standout} + \begingroup + \setkeys{beamerframe}{c} + \setkeys{beamerframe}{noframenumbering} + \ifbeamercolorempty[bg]{palette primary}{ + \setbeamercolor{background canvas}{ + use=palette primary, + bg=-palette primary.fg + } + }{ + \setbeamercolor{background canvas}{ + use=palette primary, + bg=palette primary.bg + } + } + \centering + \usebeamercolor[fg]{palette primary} + \usebeamerfont{standout} +} +% \end{macrocode} +% +% Then we just have to close the group after the standout slide is finished +% in order to restore the colours and fonts for the rest of the +% presentation. Unfortunately, we cannot use \AfterEndEnvironment{frame} for +% this (see \url{http://tex.stackexchange.com/questions/226319/}). +% Instead, we add the |\endgroup| to |\beamer@reseteecodes|, which is run +% exactly once at the end of each slide. +% +% \begin{macrocode} + \apptocmd{\beamer@reseteecodes}{% + \ifbool{metropolis@standout}{ + \endgroup + \boolfalse{metropolis@standout} + }{} + }{}{} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Process package options} % % \begin{macrocode} -\@metropolis@inner@setdefaults +\metropolis@inner@setdefaults \ProcessPgfPackageOptions{/metropolis/inner} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerouterthememetropolis.dtx b/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerouterthememetropolis.dtx index 2b3df9d73fd..6a9044ff30c 100644 --- a/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerouterthememetropolis.dtx +++ b/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerouterthememetropolis.dtx @@ -10,16 +10,10 @@ % International License (https://creativecommons.org/licenses/by-sa/4.0/). % ------------------------------------------------------------------------- \fi % \iffalse -%<driver> \ProvidesFile{beamerouterthememetropolis.dtx} %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerouterthememetropolis}[2015/12/04 Metropolis outer theme] +\ProvidesPackage{beamerouterthememetropolis}[2016/03/14 Metropolis outer theme] %</package> -%<driver> \documentclass{ltxdoc} -%<driver> \usepackage{beamerouterthememetropolis} -%<driver> \begin{document} -%<driver> \DocInput{beamerouterthememetropolis.dtx} -%<driver> \end{document} % \fi % \CheckSum{0} % \StopEventually{} @@ -27,12 +21,15 @@ %<*package> % ------------------------------------------------------------------------- \fi % -% \subsection{\textsc{metropolis} outer theme} +% \subsection{\themename 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. % -% Load required packages. +% +% +% \subsubsection{Package dependencies} +% % \begin{macrocode} \RequirePackage{etoolbox} \RequirePackage{calc} @@ -44,7 +41,7 @@ % \subsubsection{Options} % % \begin{macro}{numbering} -% This option controls the page numbering. +% Adds slide numbers to the bottom right of each slide. % \begin{macrocode} \pgfkeys{ /metropolis/outer/numbering/.cd, @@ -57,7 +54,7 @@ % \end{macro} % % \begin{macro}{progressbar} -% This option controls the progressbar. +% Adds a progress bar to the top, bottom, or frametitle of each slide. % \begin{macrocode} \pgfkeys{ /metropolis/outer/progressbar/.cd, @@ -86,58 +83,13 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{frametitleformat} -% Control the titleformat of the frame title -% \begin{macrocode} -\pgfkeys{ - /metropolis/outer/titleformat frame/.cd, - .is choice, - regular/.code={% - \let\@metropolis@frametitleformat\@empty% - \setbeamerfont{frametitle}{shape=\normalfont}% - \renewcommand{\@metropolis@frametitlestrut}{% - \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}% - } - }, - smallcaps/.code={% - \let\@metropolis@frametitleformat\@empty% - \setbeamerfont{frametitle}{shape=\scshape}% - \renewcommand{\@metropolis@frametitlestrut}{% - \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz}% - } - }, - allsmallcaps/.code={% - \let\@metropolis@frametitleformat\MakeLowercase% - \setbeamerfont{frametitle}{shape=\scshape}% - \renewcommand{\@metropolis@frametitlestrut}{% - \vphantom{abcdefghijklmnopqrstuvwxyz}% - } - \PackageWarning{beamerthememetropolis}{% - Be aware that titleformat frame=allsmallcaps can lead to problems% - } - }, - allcaps/.code={% - \let\@metropolis@frametitleformat\MakeUppercase% - \setbeamerfont{frametitle}{shape=\normalfont} - \renewcommand{\@metropolis@frametitlestrut}{% - \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZ}% - } - \PackageWarning{beamerthememetropolis}{% - Be aware that titleformat frame=allcaps can lead to problems% - } - }, -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\@metropolis@outer@setdefaults} -% Set default values for outer theme options. +% \begin{macro}{\metropolis@outer@setdefaults} +% Sets default values for outer theme options. % \begin{macrocode} -\newcommand{\@metropolis@outer@setdefaults}{ +\newcommand{\metropolis@outer@setdefaults}{ \pgfkeys{/metropolis/outer/.cd, numbering=counter, progressbar=none, - titleformat frame=regular, } } % \end{macrocode}% @@ -148,14 +100,19 @@ % \subsubsection{Head and footline} % % All good |beamer| presentations should already remove the navigation symbols, -% but \textsc{metropolis} removes them automatically (just in case). +% but \themename removes them automatically (just in case). % % \begin{macrocode} \setbeamertemplate{navigation symbols}{} % \end{macrocode} % -% Templates for the frame number. Can be omitted, shown or displayed as a -% fraction of the total frames. +% \begin{macro}{frame numbering} +% Templates for the frame number. Can be omitted, shown or displayed as a +% fraction of the total frames. +% \begin{macrocode} +\defbeamertemplate{frame footer}{none}{} +\defbeamertemplate{frame footer}{custom}[1]{ #1 } +% \end{macrocode} % % \begin{macrocode} \defbeamertemplate{frame numbering}{none}{} @@ -164,79 +121,63 @@ \insertframenumber/\inserttotalframenumber } % \end{macrocode} +% \end{macro} % +% \begin{macro}{headline} +% \begin{macro}{footline} +% Templates for the head- and footline at the top and bottom of each frame. % \begin{macrocode} \defbeamertemplate{headline}{plain}{} \defbeamertemplate{footline}{plain}{% \begin{beamercolorbox}[wd=\textwidth, sep=3ex]{footline}% - \hfill% \usebeamerfont{page number in head/foot}% + \usebeamertemplate*{frame footer} + \hfill% \usebeamertemplate*{frame numbering} \end{beamercolorbox}% } % \end{macrocode} +% \end{macro} +% \end{macro} % % % % \subsubsection{Frametitle} % -% \begin{macro}{\@metropolis@frametitleformat} -% Define a hook to change the case format of the frame title. -% \begin{macrocode} -\def\@metropolis@frametitleformat#1{#1} -% \end{macrocode} -% \end{macro} -% -% To make the |\MakeLowercase| and |\MakeUppercase| macros work in the -% frame title we have to patch |\beamer@@frametitle|. This solution was -% suggested by Enrico Gregorio in an answer to -% \href{http://tex.stackexchange.com/questions/112526/}{this StackExchange -% question}. -% -% \begin{macrocode} -\patchcmd{\beamer@@frametitle} - {\beamer@ifempty{#2}{}{% - \gdef\insertframetitle{{#2\ifnum\beamer@autobreakcount>0\relax{}\space% - \usebeamertemplate*{frametitle continuation}\fi}}% - \gdef\beamer@frametitle{#2}% - \gdef\beamer@shortframetitle{#1}% - }} - {\beamer@ifempty{#2}{}{% - \gdef\insertframetitle{{\@metropolis@frametitleformat{#2}\ifnum% - \beamer@autobreakcount>0\relax{}\space% - \usebeamertemplate*{frametitle continuation}\fi}}% - \gdef\beamer@frametitle{#2}% - \gdef\beamer@shortframetitle{#1}% - }} - {} - {\PackageError{beamerouterthememetropolis}{Patching frame title failed}} -% \end{macrocode} -% % \begin{macro}{frametitle} -% -% Templates for the frame title, which is optionally underlined with a -% progress bar. -% +% Templates for the frame title, which is optionally underlined with a +% progress bar. % \begin{macrocode} -\newlength{\@metropolis@frametitlestrut} +\newlength{\metropolis@frametitle@padding} +\setlength{\metropolis@frametitle@padding}{2.2ex} +\newcommand{\metropolis@frametitlestrut@start}{ + \rule{0pt}{\metropolis@frametitle@padding +% + \totalheightof{% + \ifcsdef{metropolis@frametitleformat}{\metropolis@frametitleformat X}{X}% + }% + }% +} +\newcommand{\metropolis@frametitlestrut@end}{ + \rule[-\metropolis@frametitle@padding]{0pt}{\metropolis@frametitle@padding} +} \defbeamertemplate{frametitle}{plain}{% \nointerlineskip% \begin{beamercolorbox}[% wd=\paperwidth,% - sep=1.5ex,% + sep=0pt,% + leftskip=\metropolis@frametitle@padding,% + rightskip=\metropolis@frametitle@padding,% ]{frametitle}% - \@metropolis@frametitlestrut\insertframetitle\@metropolis@frametitlestrut% + \metropolis@frametitlestrut@start\insertframetitle\metropolis@frametitlestrut@end% \end{beamercolorbox}% } % \end{macrocode} % \end{macro} % % \begin{macro}{progress bar in head/foot} -% -% Template for the progress bar optionally displayed below the frame title -% on each page. Much of this code is duplicated in the inner theme's template -% |progress bar in section page|. -% +% Template for the progress bar optionally displayed below the frame title +% on each page. Much of this code is duplicated in the inner theme's +% template |progress bar in section page|. % \begin{macrocode} \newlength{\metropolis@progressinheadfoot} \setbeamertemplate{progress bar in head/foot}{ @@ -254,10 +195,28 @@ % \end{macrocode} % \end{macro} % -% Process package options +% +% +% \begin{macro}{appendix} +% Removes page numbering and per-slide progress bars when |\appendix| is +% called. This makes it easier to include additional ``backup slides'' at +% the end of the presentation, especially in conjunction with the package +% |appendixnumberbeamer|. +% \begin{macrocode} +\AtBeginDocument{% + \apptocmd{\appendix}{% + \pgfkeys{% + /metropolis/outer/.cd, + numbering=none, + progressbar=none} + }{}{} +} +% \end{macrocode} +% \end{macro} +% \subsubsection{Process package options} % % \begin{macrocode} -\@metropolis@outer@setdefaults +\metropolis@outer@setdefaults \ProcessPgfPackageOptions{/metropolis/outer} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerthememetropolis.dtx b/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerthememetropolis.dtx index 0cec598d0db..7bdbf84a9b6 100644 --- a/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerthememetropolis.dtx +++ b/Master/texmf-dist/source/latex/beamertheme-metropolis/beamerthememetropolis.dtx @@ -10,16 +10,11 @@ % International License (https://creativecommons.org/licenses/by-sa/4.0/). % ------------------------------------------------------------------------- \fi % \iffalse -%<driver> \ProvidesFile{beamerthememetropolis.dtx} %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerthememetropolis}[2015/12/04 Metropolis Beamer theme] +\ProvidesPackage{beamerthememetropolis} + [2016/03/14 v1.1 Metropolis Beamer theme] %</package> -%<driver> \documentclass{ltxdoc} -%<driver> \usepackage{beamerthememetropolis} -%<driver> \begin{document} -%<driver> \DocInput{beamerthememetropolis.dtx} -%<driver> \end{document} % \fi % \CheckSum{0} % \StopEventually{} @@ -27,28 +22,26 @@ %<*package> % ------------------------------------------------------------------------- \fi % -% \subsection{\textsc{metropolis} main theme} +% \subsection{\themename parent 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 +% \themename theme and route the theme options accordingly. It also % provides some custom commands and environments for the user. % -% Load the required packages. +% +% +% \subsubsection{Package dependencies} +% % \begin{macrocode} \RequirePackage{etoolbox} \RequirePackage{pgfopts} % \end{macrocode} % -% \subsubsection{Options} % -% \begin{macro}{\metroset} -% First of all we define a macro for the user to set options. -% \begin{macrocode} -\newcommand{\metroset}[1]{\pgfkeys{/metropolis/.cd,#1}} -% \end{macrocode} -% \end{macro} % -% Then we need to pass the unknown options to the sub-packages. +% \subsubsection{Options} +% +% Most options are passed off to the component sub-packages. % % \begin{macrocode} \pgfkeys{/metropolis/.cd, @@ -56,43 +49,35 @@ /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, - }, + /metropolis/font, + } } % \end{macrocode} % % \begin{macro}{titleformat plain} -% Control the titleformat of the plain title +% Controls the formatting of the text on standout ``plain'' frames. % \begin{macrocode} \pgfkeys{ /metropolis/titleformat plain/.cd, .is choice, regular/.code={% - \let\@metropolis@plaintitleformat\@empty% - \setbeamerfont{plain title}{shape=\normalfont}% + \let\metropolis@plaintitleformat\@empty% + \setbeamerfont{standout}{shape=\normalfont}% }, smallcaps/.code={% - \let\@metropolis@plaintitleformat\@empty% - \setbeamerfont{plain title}{shape=\scshape}% + \let\metropolis@plaintitleformat\@empty% + \setbeamerfont{standout}{shape=\scshape}% }, allsmallcaps/.code={% - \let\@metropolis@plaintitleformat\MakeLowercase% - \setbeamerfont{plain title}{shape=\scshape}% + \let\metropolis@plaintitleformat\MakeLowercase% + \setbeamerfont{standout}{shape=\scshape}% \PackageWarning{beamerthememetropolis}{% Be aware that titleformat plain=allsmallcaps can lead to problems% } }, allcaps/.code={% - \let\@metropolis@plaintitleformat\MakeUppercase% - \setbeamerfont{plain title}{shape=\normalfont}% + \let\metropolis@plaintitleformat\MakeUppercase% + \setbeamerfont{standout}{shape=\normalfont}% \PackageWarning{beamerthememetropolis}{% Be aware that titleformat plain=allcaps can lead to problems% } @@ -102,14 +87,15 @@ % \end{macro} % % \begin{macro}{titleformat} -% Control the titleformat of every title type together +% Sets a standard format for titles, subtitles, section titles, frame +% titles, and the text on standout ``plain'' frames. % \begin{macrocode} \pgfkeys{ /metropolis/titleformat/.code=\pgfkeysalso{ - inner/titleformat title=#1, - inner/titleformat subtitle=#1, - inner/titleformat section=#1, - outer/titleformat frame=#1, + font/titleformat title=#1, + font/titleformat subtitle=#1, + font/titleformat section=#1, + font/titleformat frame=#1, titleformat plain=#1, } } @@ -133,7 +119,7 @@ % Set default values for options. % % \begin{macrocode} -\newcommand{\@metropolis@setdefaults}{ +\newcommand{\metropolis@setdefaults}{ \pgfkeys{/metropolis/.cd, titleformat plain=regular, } @@ -146,6 +132,7 @@ % % Having processed the options, we can now load the component sub-packages of % the theme. +% % \begin{macrocode} \useinnertheme{metropolis} \useoutertheme{metropolis} @@ -167,34 +154,30 @@ % % \subsubsection{Custom commands} % -% We define custom commands in this package as their proper usage may depend +% The parent theme defines custom commands 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{macro}{\metroset} +% Allows the user to change options midway through a presentation. % \begin{macrocode} -\def\@metropolis@plaintitleformat#1{#1} +\newcommand{\metroset}[1]{\pgfkeys{/metropolis/.cd,#1}} % \end{macrocode} % \end{macro} % % \begin{macro}{\plain} % Creates a plain frame with dark background, suitable for displaying images -% or a few words. +% or a few words. The format of the text can be set with the +% |titleformat plain| option. % \begin{macrocode} +\def\metropolis@plaintitleformat#1{#1} \newcommand{\plain}[2][]{% - \begingroup - \setbeamercolor{background canvas}{ - use=palette primary, - parent=palette primary - } - \begin{frame}[c]{#1} - \begin{center} - \usebeamercolor[fg]{palette primary} - \usebeamerfont{plain title} - \@metropolis@plaintitleformat{#2} - \end{center} - \end{frame} - \endgroup + \PackageWarning{beamerthememetropolis}{% + The syntax `\plain' may be deprecated in a future version of Metropolis. + Please use a frame with [standout] instead. + } + \begin{frame}[standout]{#1} + \metropolis@plaintitleformat{#2} + \end{frame} } % \end{macrocode} % \end{macro} @@ -205,10 +188,12 @@ % \end{macrocode} % \end{macro} % -% Process package options +% +% +% \subsubsection{Process package options} % % \begin{macrocode} -\@metropolis@setdefaults +\metropolis@setdefaults \ProcessPgfOptions{/metropolis} % \end{macrocode} % diff --git a/Master/texmf-dist/source/latex/beamertheme-metropolis/metropolistheme.dtx b/Master/texmf-dist/source/latex/beamertheme-metropolis/metropolistheme.dtx index d78c6dd2f7b..4baf2607018 100644 --- a/Master/texmf-dist/source/latex/beamertheme-metropolis/metropolistheme.dtx +++ b/Master/texmf-dist/source/latex/beamertheme-metropolis/metropolistheme.dtx @@ -37,7 +37,7 @@ \suppressfontnotfounderror=0% } - \newcommand{\iffontsexist}[3]{% + \newcommand{\iffontsavailable}[3]{% \setcounter{fontsnotfound}{0}% \expandafter\forcsvlist\expandafter% \checkfont\expandafter{#1}% @@ -47,13 +47,13 @@ #3% \fi% } - \iffontsexist{Fira Sans Light,% + \iffontsavailable{Fira Sans Light,% Fira Sans Light Italic,% Fira Sans,% Fira Sans Italic}{% \setmainfont[BoldFont={Fira Sans}]{Fira Sans Light}% }{% - \iffontsexist{Fira Sans Light OT,% + \iffontsavailable{Fira Sans Light OT,% Fira Sans Light Italic OT,% Fira Sans OT,% Fira Sans Italic OT}{% @@ -65,10 +65,10 @@ } } } - \iffontsexist{Fira Mono, Fira Mono Bold}{% + \iffontsavailable{Fira Mono, Fira Mono Bold}{% \setmonofont{Fira Mono}% }{% - \iffontsexist{Fira Mono OT, Fira Mono Bold OT}{% + \iffontsavailable{Fira Mono OT, Fira Mono Bold OT}{% \setmonofont{Fira Mono OT}% }{% \typeout{% @@ -125,6 +125,7 @@ plain,setbeamercolor,metroset,setsansfont,setmonofont}, } \lstMakeShortInline| +\usepackage{metalogo} \usepackage[colorlinks=true, linkcolor=mLightBrown, @@ -144,23 +145,25 @@ \newcommand{\themename}{\textbf{\textsc{metropolis}}\xspace} -\GetFileInfo{beamerthememetropolis.dtx} +\usepackage{readprov} +\ReadPackageInfos{beamerthememetropolis} + \title{Modern Beamer Presentations with the \themename package} \author{Matthias Vogelgesang \\ \url{matthias.vogelgesang@gmail.com}} -\date{v1.0} +\date{\fileversion~---~\filedate} \begin{document} \maketitle \tableofcontents + \section{Introduction} Beamer is an awesome way to make presentations with LaTeX, but its theme -selection is surprisingly sparse. The stock themes share an aesthetic that is -now overused and can be a little cluttered, and the few distinctive custom -themes available are often specialized for a particular corporate or -institutional brand. +selection is surprisingly sparse. The stock themes share an aesthetic that can +be a little cluttered, while the few distinctive custom themes available are +often specialized for a particular corporate or institutional brand. The goal of \themename is to provide a simple, modern Beamer theme suitable for anyone to use. It tries to minimize noise and maximize space for content; @@ -171,7 +174,7 @@ By default, \themename uses \href{https://www.mozilla.org/en-US/styleguide/products/firefox-os/typeface/} {Fira Sans}, a gorgeous typeface commissioned by Mozilla and designed by \href{http://www.carrois.com/fira-3-1/}{Carrois}. For best results, you will -need the Fira typeface installed and use Xe\LaTeX{} to typeset your slides. +need the Fira typeface installed and use \XeLaTeX\ to typeset your slides. However, \themename can also be used with other typefaces and \LaTeX{} build systems. @@ -185,25 +188,37 @@ the theme even better, please get in touch there. The \section{Getting Started} \subsection{Installing from CTAN} -For the regular user it is recommended to install \themename from -\href{https://www.ctan.org}{CTAN}. In case you keep your \TeX\ distribution -up-to-date, chances are good that \themename is already installed. If it is not, -you need to update your packages. For \TeX\ Live (or Mac\TeX\ on OS X) the -following command updates all packages. + +For most users, we recommend installing \themename from +\href{https://www.ctan.org}{CTAN}. If you keep your \TeX\ distribution +up-to-date, chances are good that \themename is already installed. If it is +not, you need to update your packages. If your distribution is \TeX\ Live +(or Mac\TeX\ on OS X), the following command updates all packages. + +\begin{lstlisting} +tlmgr update --all +\end{lstlisting} + +If this results in an error, you may need to run it with administrative privileges: \begin{lstlisting} sudo tlmgr update --all \end{lstlisting} -For any other distribution please refer to its documentation on how to update your -packages. +Mac\TeX\ on OS X also provides a graphical interface for |tlmgr| called +\TeX\ Live Utility. + +For any other distribution please refer to its documentation on how to update +your packages. + +To get the most out of the theme you should also install the |Fira| fonts. +However, this is not mandatory; \themename also works with the standard fonts. -To get the most out of the theme you should also install the |Fira| fonts. Yet this -is not mandatory. \themename also works with the standard fonts. \subsection{Installing from GitHub} -Installing \themename, like any Beamer theme, involves four easy steps: +If you want to use the cutting-edge development version of \themename, you can +install it manually. Like any \LaTeX\ package, this involves four easy steps: \begin{description} \item[Download the source] with a |git clone| of the \href{https://github.com/matze/mtheme}{\themename repository} or as a @@ -230,17 +245,12 @@ options for advanced users: \item[|make doc|] builds this documentation manual. \item[|make demo|] builds a demo presentation to test the features of \themename. - \item[|make all|] builds the theme, manual, and demo presentation. + \item[|make all|] builds the theme and manual. \item[|make clean|] removes the files generated by |make all|. \item[|make install|] installs the theme into your local texmf folder. \item[|make uninstall|] removes the theme from your local texmf folder. - \item[|make ctan|] creates a package for CTAN distribution. \end{description} -\subsection{Installing the Debian Package} -As an alternative users of Debian or Ubuntu can also install this -\href{https://launchpad.net/\%7Eedd/+archive/ubuntu/misc/+files/latex-mtheme_0.1.0vidid1_all.deb}{.deb package} -containing the theme files as well as the Fira Sans font files. \subsection{A Minimal Example} @@ -266,17 +276,28 @@ The following code shows a minimal example of a Beamer presentation using \subsection{Dependencies} -\begin{itemize} - \item TikZ - \item XeLaTeX or LuaTeX - \item \href{https://github.com/mozilla/Fira}{Fira Sans} and Mono font -\end{itemize} +\themename depends on the |beamer| class and the following standard packages: +\begin{multicols}{3} + \begin{itemize} + \item |tikz| + \item |pgfopts| + \item |etoolbox| + \item |calc| + \item |ifxetex| + \item |ifluatex| + \end{itemize} +\end{multicols} + +For best results, we recommend installing the fonts +\href{https://github.com/mozilla/Fira}{|Fira Sans|} and |Fira Mono| +and compiling with \themename using \XeLaTeX\ or \LuaTeX. +These are optional dependencies; \themename is compatible with (e.g.) +pdf\LaTeX\ and will fall back to standard fonts if |Fira Sans| or |Fira Mono| +is not installed. + +The packaged name of |Fira Sans| is |Fira Sans OT| in some Linux +distributions; this case is automatically handled by \themename. -The |Fira Sans| font is not a hard dependency. \themename will try to load the -font and use it if it is installed, but if not it will just use the standard -font. Depending on the Linux distribution, the packaged name of |Fira Sans| -might be |Fira Sans OT| instead of |Fira Sans|. \themename will check for this -name too. \subsection{Pandoc} @@ -284,118 +305,110 @@ To use this theme with \href{http://johnmacfarlane.net/pandoc/}{Pandoc}-based presentations, you can run the following command \begin{lstlisting} -$ pandoc -t beamer --latex-engine=xelatex -V theme:m -o output.pdf input.md +$ pandoc -t beamer --latex-engine=xelatex -V theme:metropolis -o output.pdf input.md \end{lstlisting} - - \section{Customization} + \subsection{Package options} -The theme provides a number of options. The options use a key=value interface. -So every option is controlled by a key its value. To use an option you can -either provide a comma separated list of options when invoking -\textsc{metropolis} in the preamble of the presentation. -\begin{lstlisting} -\usetheme[<key=value list>]{metropolis} -\end{lstlisting} -Or you can set them at any time with the |\metroset| macro. + +The theme provides a number of options, which can be set using a key=value +interface. The primary way to set options is to provide a comma-separated list +of option-value pairs when loading \themename in the preamble: \begin{lstlisting} -\metroset{<key=value list>} +\usetheme[option1=value1, option2=value2, ...]{metropolis} \end{lstlisting} -To set an option on a specific sub-package only you have to add the -corresponding prefix (inner, outer, color), e.g. + +Options can be changed at any time --- even mid-presentation! --- with the +|\metroset| macro. \begin{lstlisting} -\metroset{inner/block=fill} +\metroset{option1=newvalue1, option2=newvalue2, ...} \end{lstlisting} + The list of options is structured as shown in the following example. -\DescribeOption{key}{list of possible values}{default value}{ +\DescribeOption{option key}{list of possible values}{default}{ A short description of the option. } -Although the options are grouped into the corresponding packages every option -can and in most cases should be set on the main theme directly. If an option -is listed in multiple sub-packages, setting it on the main theme will set the -option on every sub-package accordingly. \subsubsection{Main theme} + \DescribeOption{titleformat}% {regular, smallcaps, allsmallcaps, allcaps} {regular}{ - Shortcut option to change the titleformat of all titles together. Please - refer to section \ref{sec:titleformats} for known issues. + Changes the format of titles, subtitles, section titles, frame titles, and + the text on ``standout'' frames. The available options produce + Regular, \textsc{SmallCaps}, \textsc{\MakeLowercase{AllSmallCaps}}, or + \MakeUppercase{AllCaps} titles. Please refer to + Section~\ref{sec:titleformats} for known issues with these options. } \DescribeOption{titleformat plain}% {regular, smallcaps, allsmallcaps, allcaps}% {regular}{ - Control the titleformat of the plain title. Please refer to section - \ref{sec:titleformats} for known issues. + Changes the format of ``standout'' frames (see |titleformat|, above). } + \subsubsection{Inner theme} -\DescribeOption{block}{transparent, fill}{transparent}{ - This option controls the block background. It can either be filled with a - light grey or be transparent. -} \DescribeOption{sectionpage}{none, simple, progressbar}{progressbar}{ - Disable section pages at all, typeset centered section title or add a thin - progress bar below the centered section title. -} - -\DescribeOption{titleformat title}% - {regular, smallcaps, allsmallcaps, allcaps}% - {regular}{ - Control the titleformat of the title. Please refer to section - \ref{sec:titleformats} for known issues. + Adds a slide at the start of each section (|simple|) with an optional thin + progress bar below the section title (|progressbar|). The |none| option + disables the section page. } -\DescribeOption{titleformat subtitle}% - {regular, smallcaps, allsmallcaps, allcaps}% - {regular}{ - Control the titleformat of the subtitle. Please refer to section - \ref{sec:titleformats} for known issues. +\DescribeOption{subsectionpage}{none, simple, progressbar}{none}{ + Optionally adds a slide at the start of each subsection. If enabled with + the |simple| or |progressbar| options, the style of the |section page| will + be updated to match the style of the |subsection page|. Note that section + slides and subsection slides can appear consecutively if both are enabled; + you may want to use this option together with |sectionpage=none| depending + on the section structure of your presentation. } -\DescribeOption{titleformat section}% - {regular, smallcaps, allsmallcaps, allcaps}% - {regular}{ - Control the titleformat of the section title. Please refer to section - \ref{sec:titleformats} for known issues. -} \subsubsection{Outer theme} + \DescribeOption{numbering}{none, counter, fraction}{counter}{ - In the bottom right corner of each frame the current frame number is - displayed. This can be disabled or the total framenumber can be added - additionally. + Controls whether the frame number at the bottom right of each slide is + omitted (|none|), shown (|counter|) or displayed as a fraction of the total + number of frames (|fraction|). } \DescribeOption{progressbar}{none, head, frametitle, foot}{none}{ - Adds a progress bar to the top of each frame (|head|), the bottom of each - frame (|foot|), or directly below each frame title (|frametitle|). -} - -\DescribeOption{titleformat frame}% - {regular, smallcaps, allsmallcaps, allcaps}% - {regular}{ - Control the titleformat of the frame title. Please refer to section - \ref{sec:titleformats} for known issues. + Optionally adds a progress bar to the top of each frame (|head|), + the bottom of each frame (|foot|), or directly below each frame title + (|frametitle|). } \subsubsection{Color theme} \DescribeOption{block}{transparent, fill}{transparent}{ - This option controls the block background. It can either be filled with a - light grey or be transparent. + Optionally adds a light grey background to block environments like |theorem| + and |example|. } \DescribeOption{background}{dark, light}{light}{ - This option defines whether the background shall be dark and the foreground - be light or vice versa. + Provides the option to have a dark background and light foreground instead + of the reverse. +} + + +\subsubsection{Font theme} + +\DescribeMacro{titleformat title} +\DescribeMacro{titleformat subtitle} +\DescribeMacro{titeformat section} +\DescribeOption{titleformat frame}% + {regular, smallcaps, allsmallcaps, allcaps}% + {regular}{ + Individually controls the format of titles, subtitles, section titles, and + frame titles (see |titleformat|, above). } + \subsection{Color Customization} The included \themename color theme is used by default, but its colors can be @@ -406,6 +419,7 @@ terms of three beamer colors: \item |alerted text| (colored fg, should be visible against dark or light) \item |example text| (colored fg, should be visible against dark or light) \end{itemize} + An easy way to customize the theme is to redefine these colors using \begin{lstlisting} @@ -422,24 +436,32 @@ of \themename specific colors, which can also be redefined to your liking. \setbeamercolor{progress bar in section page}{ ... } \end{lstlisting} + \subsection{Font Customization} -The default font for \themename is |Fira|. Yet this can be easily changed using +The default font for \themename is |Fira|. This can be easily changed using the standard font selection commands of the \textsf{fontspec} package. So if -you for example prefer the \href{http://font.ubuntu.com}{|Ubuntu|} font family -just add the following two commands after loading the \themename theme. +you prefer, for example, the \href{http://font.ubuntu.com}{|Ubuntu|} font family, just add the following two commands after loading the \themename theme. \begin{lstlisting} \setsansfont{Ubuntu} \setmonofont{Ubuntu Mono} \end{lstlisting} +If you are expecting to present in a large room or with an underpowered +projector, you may want to change the font to a heavier weight of Fira to +maximize readability. + +\begin{lstlisting} +\setsansfont[BoldFont={Fira Sans SemiBold}]{Fira Sans Book} +\end{lstlisting} + \subsubsection{Old style figures} The regular \textsf{fontspec} mechanism for changing glyph appearance applies -also to this theme. In case you want to have old style figures in the text but -regular lined figures for math, you have to add the following to your preamble: +also to this theme. If you want to have old style figures in the text but +regular lined figures for math, you could add the following to your preamble: \begin{lstlisting} \usefonttheme{professionalfonts} % required for mathspec @@ -452,41 +474,84 @@ regular lined figures for math, you have to add the following to your preamble: \subsection{Commands} -\begin{macro}{\plain} -The \lstinline|\plain{title=[]}{<body>}| command sets a slide in with a plain -dark background, which can be useful to focus attention on a single sentence -or image. +\subsubsection{Standout frames} + +The \themename inner theme offers a custom frame format with large, centered +text and an inverted background --- perfect for focusing attention on +single sentence or image. To use it, add the key |standout| to the frame: + +\begin{lstlisting} +\begin{frame}[standout] + Thank you! +\end{frame} +\end{lstlisting} + + + +\section{\texttt{pgfplots} integration} + +\themename comes with a set of pre-defined pgfplots styles and a color theme +based on Paul Tol's color scheme. + + +\subsection{Styles} + +Pass the following style keys to the axis environment to get the appropriate +effect: + +\begin{macro}{mlineplot} + Plot regular line charts with reduced axis frames, less intrusive legend and + subdued grid. +\end{macro} +\begin{macro}{mbarplot} + Plot vertical bar charts in a similar way as |mlineplot| but reduce grid usage. +\end{macro} +\begin{macro}{horizontal mbarplot} + Plot horizontal bar charts. +\end{macro} +\begin{macro}{disable thousands separator} + Helper style to remove thousands separator. \end{macro} -\subsection{Paul Tol's colors: a \texttt{pgfplots} theme} -A good presentation uses colors that are +\subsection{Paul Tol colors} -\begin{itemize} - \item distinct from each other as much as possible, and - \item distinct from black and white, - \item under many different lighting and display environments, and - \item to color-blind viewers, - \item all while matching well together. -\end{itemize} +A good presentation uses colors that are distinct from each other as much as +possible as well as from black and white, can be discerned item under different +lighting and display environments and by color-blind viewers, while matching +well together. In a \href{https://personal.sron.nl/~pault/colourschemes.pdf}{technical note} for SRON, Paul Tol proposed a palette of colors satisfying these constraints. The sub-package |pgfplotsthemetol| defines palettes for |pgfplots| charts -based on Tol's work. Use the |mlineplot| key to plot line data and |mbarplot| -or horizontal |mbarplot| to plot bar charts. +based on Tol's work. + + +\section{Tips \& Tricks} + +\subsection{Backup Slides} + +Speakers will often include extra slides at the end of their presentation to +refer to during audience questions. One easy way to do this is to include the +\verb|appendixnumberbeamer| package in your preamble and call \verb|\appendix| before your backup slides. + +\themename will automatically turn off slide numbering and progress bars for +slides in the appendix. \section{Known Issues} -\subsection{Titleformats} +\subsection{Title formats} \label{sec:titleformats} -If you want to use either |smallcaps| or |allsmallcaps| be aware that not -every font supports small caps. So make sure the font you are using does. -|allsmallcaps| and |allcaps| are quite nice from an aesthetic point of view, -but they introduce some issues by using |\MakeLowercase| and |\MakeUppercase|, -respectively. +Be aware that not every font supports small caps, so the |smallcaps| or +|allsmallcaps| options may not work if you use a font other than |Fira Sans|. +In particular, the Computer Modern sans-serif typeface, which is used when +\themename is compiled with pdf\LaTeX, does not have a small-caps variant. + +The title format options |allsmallcaps| and |allcaps| are quite nice from an +aesthetic point of view, but their use of |\MakeLowercase| and +|\MakeUppercase| can cause unexpected problems. For example: \begin{itemize} \item Some commands, like |\\|, do not work inside |\MakeLowercase| and @@ -505,19 +570,74 @@ respectively. \href{https://github.com/matze/mtheme/issues/153}{\#153}) \end{itemize} -\subsection{Plain Frame} -The |\plain| command does not work if you override the \themename color theme -with the default beamer color theme |fly|. +The |allsmallcaps| and |allcaps| options are safe to use if your titles contain +only alphabetic characters and do not require the expansion of any macros. + + +\subsection{Interactions with other color themes} + +\themename can be used along with any other Beamer color theme, such as +|crane| or |seahorse|. If you wish to do this, it is usually best to include +the \themename subpackages individually so the \themename color theme is +never loaded. This will prevent conflicts between the \themename color theme +and your preferred theme. + +For example, overriding the color theme as follows may not work as expected because |\usetheme{metropolis}| loads the \themename color theme, which +defines a relationship between the frametitle background and the primary +palette of the theme. Since |seahorse| assumes a different relationship +between its palettes, the result is a grey, rather than periwinkle, +frametitle background. + +\begin{lstlisting} +\usetheme{metropolis} +\usecolortheme{seahorse} +\end{lstlisting} + +The correct colors are chosen if the \themename outer, inner, and font themes +are loaded seperately: + +\begin{lstlisting} +\useoutertheme{metropolis} +\useinnertheme{metropolis} +\usefonttheme{metropolis} +\usecolortheme{seahorse} % or your preferred color theme +\end{lstlisting} + +Please note that \themename may not use all the colors defined in your +favourite Beamer color theme. In particular, \themename does not set a +background color for the title; this will cause issues when using color themes +like |whale| which set a white foreground for the title. + + +\subsection{Notes on second screen} + +If you use the |[show notes on second screen]| option built in to Beamer and +compile with \XeLaTeX, text on slides following the first section slide may +be rendered in white instead of the regular colour. This is due to +\href{http://tex.stackexchange.com/questions/288408/}{a bug} in Beamer +or \XeLaTeX\ itself. You can work around it either by compiling with \LuaTeX\ +or by adding the following code to your preamble to reset the text color +on each slide. + +\begin{lstlisting} +\makeatletter +\def\beamer@framenotesbegin{% at beginning of slide + \usebeamercolor[fg]{normal text} + \gdef\beamer@noteitems{}% + \gdef\beamer@notes{}% +} +\makeatother +\end{lstlisting} + \section{License} -The theme itself is licensed under a +\themename is licensed under a \href{http://creativecommons.org/licenses/by-sa/4.0/}{Creative Commons -Attribution-ShareAlike 4.0 International License}. This means that if you change -the theme and re-distribute it, you must retain the copyright notice header and -license it under the same CC-BY-SA license. This does not affect the -presentation that you create with the theme. - +Attribution-ShareAlike 4.0 International License}. +This means that if you change the theme and re-distribute it, you must retain +the copyright notice header and license it under the same CC-BY-SA license. +This does not affect any presentations that you create with the theme. \section{Implementation} diff --git a/Master/texmf-dist/source/latex/beamertheme-metropolis/pgfplotsthemetol.dtx b/Master/texmf-dist/source/latex/beamertheme-metropolis/pgfplotsthemetol.dtx index 77598b06ddb..68b45054354 100644 --- a/Master/texmf-dist/source/latex/beamertheme-metropolis/pgfplotsthemetol.dtx +++ b/Master/texmf-dist/source/latex/beamertheme-metropolis/pgfplotsthemetol.dtx @@ -16,7 +16,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{pgfplotsthemetol} - [2015/06/16 PGFplots colors based on Paul Tol's SRON technical note] + [2016/03/14 PGFplots colors based on Paul Tol's SRON technical note] %</package> %<driver> \documentclass{ltxdoc} %<driver> \usepackage{pgfplotsthemetol} |