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/tex/latex/beamertheme-metropolis/beamerinnerthememetropolis.sty | |
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/tex/latex/beamertheme-metropolis/beamerinnerthememetropolis.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/beamertheme-metropolis/beamerinnerthememetropolis.sty | 330 |
1 files changed, 133 insertions, 197 deletions
diff --git a/Master/texmf-dist/tex/latex/beamertheme-metropolis/beamerinnerthememetropolis.sty b/Master/texmf-dist/tex/latex/beamertheme-metropolis/beamerinnerthememetropolis.sty index 982e50e7f56..84431f025ba 100644 --- a/Master/texmf-dist/tex/latex/beamertheme-metropolis/beamerinnerthememetropolis.sty +++ b/Master/texmf-dist/tex/latex/beamertheme-metropolis/beamerinnerthememetropolis.sty @@ -17,125 +17,36 @@ %% International License (https://creativecommons.org/licenses/by-sa/4.0/). %% --------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerinnerthememetropolis}[2015/12/04 Metropolis inner theme] +\ProvidesPackage{beamerinnerthememetropolis}[2016/03/14 Metropolis inner theme] \RequirePackage{etoolbox} +\RequirePackage{keyval} \RequirePackage{calc} \RequirePackage{pgfopts} \RequirePackage{tikz} \pgfkeys{ - /metropolis/inner/block/.cd, - .is choice, - transparent/.code=\setlength{\@metropolis@blockskip}{0ex}, - fill/.code=\setlength{\@metropolis@blockskip}{1ex}, -} -\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% - } - }, -} -\pgfkeys{ - /metropolis/inner/titleformat subtitle/.cd, + /metropolis/inner/sectionpage/.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% - } - }, + none/.code=\metropolis@disablesectionpage, + simple/.code={\metropolis@enablesectionpage + \setbeamertemplate{section page}[simple]}, + progressbar/.code={\metropolis@enablesectionpage + \setbeamertemplate{section page}[progressbar]}, } \pgfkeys{ - /metropolis/inner/titleformat section/.cd, + /metropolis/inner/subsectionpage/.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@disablesubsectionpage, + simple/.code={\metropolis@enablesubsectionpage + \setbeamertemplate{section page}[simple]}, + progressbar/.code={\metropolis@enablesubsectionpage + \setbeamertemplate{section page}[progressbar]}, } -\pgfkeys{ - /metropolis/inner/sectionpage/.cd, - .is choice, - none/.code=\@metropolis@sectionpage@none, - simple/.code=\@metropolis@sectionpage@simple, - progressbar/.code=\@metropolis@sectionpage@progressbar, -} -\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 } } -\def\@metropolis@titleformat#1{#1} -\def\@metropolis@subtitleformat#1{#1} -\def\@metropolis@sectiontitleformat#1{#1} -\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}} \setbeamertemplate{title page}{ \begin{minipage}[b][\paperheight]{\textwidth} \ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi @@ -154,7 +65,7 @@ \ifbeamer@inframe \titlepage \else - \frame[plain]{\titlepage} + \frame[plain,noframenumbering]{\titlepage} \fi } \def\titlepage{% @@ -170,12 +81,12 @@ \setbeamertemplate{title}{ \raggedright% \linespread{1.0}% - \@metropolis@titleformat{\inserttitle}% + \inserttitle% \par% \vspace*{0.5em} } \setbeamertemplate{subtitle}{ - \@metropolis@subtitleformat{\insertsubtitle}% + \insertsubtitle% \par% \vspace*{0.5em} } @@ -200,44 +111,64 @@ \insertinstitute% \par% } -\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@sectionpage@progressbar}{ - \setbeamertemplate{section page}[progressbar] +\newcommand{\metropolis@disablesectionpage}{ + \AtBeginSection{ + % intentionally empty + } +} +\newcommand{\metropolis@enablesectionpage}{ \AtBeginSection{ \ifbeamer@inframe \sectionpage \else - \frame[plain,c]{\sectionpage} + \frame[plain,c,noframenumbering]{\sectionpage} + \fi + } +} +\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 } } @@ -252,73 +183,51 @@ \end{tikzpicture}% } \def\inserttotalframenumber{100} -\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}% +\newlength{\metropolis@blocksep} +\newlength{\metropolis@blockadjust} +\setlength{\metropolis@blocksep}{0.75ex} +\setlength{\metropolis@blockadjust}{0.25ex} +\providecommand{\metropolis@strut}{% + \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()}% } -\setbeamertemplate{block end}{% - \end{beamercolorbox} - \vspace*{0.2ex} -} -\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% - \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} -} -\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% +\newcommand{\metropolis@block}[1]{ + \par\vskip\medskipamount% + \setlength{\parskip}{0pt} + \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}% + }% + {% + \begin{beamercolorbox}[ + sep=\dimexpr\metropolis@blocksep-\metropolis@blockadjust\relax, + leftskip=\metropolis@blockadjust, + rightskip=\dimexpr\metropolis@blockadjust plus 4em\relax + ]{block title#1}% + }}% + \usebeamerfont*{block title#1}% + \metropolis@strut% + \insertblocktitle% + \metropolis@strut% \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} + \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}% } +\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}} \setbeamertemplate{itemize items}{\textbullet} \setbeamertemplate{caption label separator}{: } \setbeamertemplate{caption}[numbered] @@ -327,9 +236,9 @@ \raggedright \usebeamercolor{footnote}\hbox to 0.8em{\hfil\insertfootnotemark}\insertfootnotetext\par% } -\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} \define@key{beamerframe}{c}[true]{% centered \beamer@frametopskip=0pt plus 1fill\relax% @@ -338,7 +247,34 @@ \beamer@framebottomskipautobreak=0pt plus .6\paperheight\relax% \def\beamer@initfirstlineunskip{}% } -\@metropolis@inner@setdefaults +\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} +} + \apptocmd{\beamer@reseteecodes}{% + \ifbool{metropolis@standout}{ + \endgroup + \boolfalse{metropolis@standout} + }{} + }{}{} +\metropolis@inner@setdefaults \ProcessPgfPackageOptions{/metropolis/inner} \endinput %% |