From d74c3c7b7ba68d41884806371361d9d8ede85e28 Mon Sep 17 00:00:00 2001 From: Benedikt Kleinmeier Date: Fri, 24 Apr 2015 10:20:02 +0200 Subject: [PATCH 1/2] Add three options: usesmallcapitalsintitle, usesectionslide and nototalslides. beamerfontthememetropolis.sty: - Remove "series=\scshape" for frame titles. beamerthemem.sty: - Add three options: * usesmallcapitalsintitle: print frame titles in small capitals. * usesectionslide: introduce a new section by an own slide. * nototalslides: print "#current/#total" slides per default. Disable this behavior by setting this option --- beamerfontthememetropolis.sty | 2 +- beamerthemem.sty | 31 +++++++++++++++++++++++++------ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/beamerfontthememetropolis.sty b/beamerfontthememetropolis.sty index 07f1030..58ff574 100644 --- a/beamerfontthememetropolis.sty +++ b/beamerfontthememetropolis.sty @@ -32,7 +32,7 @@ \setbeamerfont{block title alerted}{family=\Book,size=\normalsize} \setbeamerfont{subtitle}{family=\Light, size=\fontsize{12}{14}} -\setbeamerfont{frametitle}{family=\Book, series=\scshape, size=\large} +\setbeamerfont{frametitle}{family=\Book, size=\large} \setbeamerfont{caption}{size=\small} \setbeamerfont{caption name}{family=\Book} diff --git a/beamerthemem.sty b/beamerthemem.sty index 36eb441..6828bcb 100644 --- a/beamerthemem.sty +++ b/beamerthemem.sty @@ -13,9 +13,15 @@ \newif\if@useTitleProgressBar \newif\if@protectFrameTitle +\newif\if@useSmallCapitalsInTitle +\newif\if@useSectionSlide +\newif\if@noTotalSlides \@useTitleProgressBarfalse \@protectFrameTitlefalse +\@useSmallCapitalsInTitlefalse +\@useSectionSlidefalse +\@noTotalSlidesfalse \newlength{\@mtheme@voffset} \setlength{\@mtheme@voffset}{2em} @@ -31,6 +37,10 @@ \PackageWarning{beamerthemem}{Unknown option `\CurrentOption'}% } +\DeclareOptionBeamer{usesmallcapitalsintitle}{\@useSmallCapitalsInTitletrue} +\DeclareOptionBeamer{usesectionslide}{\@useSectionSlidetrue} +\DeclareOptionBeamer{nototalslides}{\@noTotalSlidestrue} + \ProcessOptionsBeamer %}}} @@ -76,7 +86,7 @@ \vfill \ifx\inserttitle\@empty% \else% - {\raggedright\linespread{1.0}\usebeamerfont{title}\usebeamercolor[fg]{title}\scshape\MakeLowercase{\inserttitle}\par}% + {\raggedright\linespread{1.0}\usebeamerfont{title}\usebeamercolor[fg]{title}\inserttitle\par}% \vspace*{0.5em} \fi% \ifx\insertsubtitle\@empty% @@ -173,8 +183,11 @@ \newcommand{\insertsectionHEAD}{% \expandafter\insertsectionHEADaux\insertsectionhead} - \newcommand{\insertsectionHEADaux}[3]{\textsc{\MakeLowercase{#3}} -} +\if@useSmallCapitalsInTitle +\newcommand{\insertsectionHEADaux}[3]{\textsc{\MakeLowercase{#3}}} +\else +\newcommand{\insertsectionHEADaux}[3]{#3} +\fi \newcommand{\plain}[2][]{% \begingroup @@ -206,6 +219,7 @@ %{{{ --- Sections --------------------- % Insert frame with section title at every section start +\if@useSectionSlide \AtBeginSection[] { \begingroup @@ -216,6 +230,7 @@ \end{frame} \endgroup } +\fi %}}} %{{{ --- Captions --------------------- @@ -231,7 +246,11 @@ {% \begin{beamercolorbox}[wd=\textwidth,ht=3ex,dp=3ex,leftskip=0.3cm,rightskip=0.3cm]{structure}% \hfill\usebeamerfont{page number in head/foot}% - \insertframenumber% + \if@noTotalSlides + \insertpagenumber% + \else + \insertpagenumber/\insertpresentationendpage% + \fi \end{beamercolorbox}% } @@ -249,9 +268,9 @@ \nointerlineskip \begin{beamercolorbox}[wd=\paperwidth,leftskip=0.3cm,rightskip=0.3cm,ht=2.5ex,dp=1.5ex]{frametitle} \if@protectFrameTitle - \usebeamerfont{frametitle}\MakeLowercase{\protect\insertframetitle}% + \usebeamerfont{frametitle}\protect\insertframetitle% \else - \usebeamerfont{frametitle}\MakeLowercase{\insertframetitle}% + \usebeamerfont{frametitle}\insertframetitle% \fi \end{beamercolorbox}% \if@useTitleProgressBar From ef61b7197ebd6144694e39bec24fc2e4f4ea0d64 Mon Sep 17 00:00:00 2001 From: Benedikt Kleinmeier Date: Sat, 25 Apr 2015 19:44:14 +0200 Subject: [PATCH 2/2] Revised three options: usesmallcapitalsintitle, usesectionslide and nototalslides. README.md: - Added explanation for these three options. beamerthemem: - Renamed all three options: * usesmallcapitalsintitle -> nosmallcapitals * usesectionslide -> nosectionslide * nototalslides -> usetotalslideindicator - Disabled all options by default. I.e., you have to enable them explicitly. --- README.md | 10 ++++++++ beamerthemem.sty | 66 ++++++++++++++++++++++++++++++------------------ 2 files changed, 51 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 60a2fab..8bafb91 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,16 @@ make content more centered on the frame. If using more content per slide, this can be turned off at the package-level by passing the `nooffset` option. +With option `nosectionslide`, no dedicated slide is produced when a new section +starts. By default when using the `\section` command, a slide is created with +just the title on it. + +The `nosmallcapitals` option supresses the usage of small capitals on +title page, frame titles and dedicated section slides. + +Option `usetotalslideindicator` creates slide numbering in lower right corner +in following format: #current/#total. By default, just current page number is +printed. #### Commands diff --git a/beamerthemem.sty b/beamerthemem.sty index 6828bcb..ecc0977 100644 --- a/beamerthemem.sty +++ b/beamerthemem.sty @@ -13,15 +13,15 @@ \newif\if@useTitleProgressBar \newif\if@protectFrameTitle -\newif\if@useSmallCapitalsInTitle -\newif\if@useSectionSlide -\newif\if@noTotalSlides +\newif\if@noSmallCapitals +\newif\if@noSectionSlide +\newif\if@useTotalSlideIndicator \@useTitleProgressBarfalse \@protectFrameTitlefalse -\@useSmallCapitalsInTitlefalse -\@useSectionSlidefalse -\@noTotalSlidesfalse +\@noSmallCapitalsfalse +\@noSectionSlidefalse +\@useTotalSlideIndicatorfalse \newlength{\@mtheme@voffset} \setlength{\@mtheme@voffset}{2em} @@ -37,9 +37,9 @@ \PackageWarning{beamerthemem}{Unknown option `\CurrentOption'}% } -\DeclareOptionBeamer{usesmallcapitalsintitle}{\@useSmallCapitalsInTitletrue} -\DeclareOptionBeamer{usesectionslide}{\@useSectionSlidetrue} -\DeclareOptionBeamer{nototalslides}{\@noTotalSlidestrue} +\DeclareOptionBeamer{nosmallcapitals}{\@noSmallCapitalstrue} +\DeclareOptionBeamer{nosectionslide}{\@noSectionSlidetrue} +\DeclareOptionBeamer{usetotalslideindicator}{\@useTotalSlideIndicatortrue} \ProcessOptionsBeamer @@ -86,7 +86,11 @@ \vfill \ifx\inserttitle\@empty% \else% + \if@noSmallCapitals% {\raggedright\linespread{1.0}\usebeamerfont{title}\usebeamercolor[fg]{title}\inserttitle\par}% + \else% + {\raggedright\linespread{1.0}\usebeamerfont{title}\usebeamercolor[fg]{title}\scshape\MakeLowercase{\inserttitle}\par}% + \fi% \vspace*{0.5em} \fi% \ifx\insertsubtitle\@empty% @@ -183,11 +187,12 @@ \newcommand{\insertsectionHEAD}{% \expandafter\insertsectionHEADaux\insertsectionhead} -\if@useSmallCapitalsInTitle -\newcommand{\insertsectionHEADaux}[3]{\textsc{\MakeLowercase{#3}}} -\else -\newcommand{\insertsectionHEADaux}[3]{#3} -\fi + +\if@noSmallCapitals% +\newcommand{\insertsectionHEADaux}[3]{#3}% +\else% +\newcommand{\insertsectionHEADaux}[3]{\textsc{\MakeLowercase{#3}}}% +\fi% \newcommand{\plain}[2][]{% \begingroup @@ -219,9 +224,10 @@ %{{{ --- Sections --------------------- % Insert frame with section title at every section start -\if@useSectionSlide \AtBeginSection[] { + \if@noSectionSlide% + \else% \begingroup \setbeamercolor{background canvas}{parent=palette primary} \begin{frame}[plain] @@ -229,8 +235,8 @@ \progressbar@sectionprogressbar% \end{frame} \endgroup + \fi% } -\fi %}}} %{{{ --- Captions --------------------- @@ -246,11 +252,11 @@ {% \begin{beamercolorbox}[wd=\textwidth,ht=3ex,dp=3ex,leftskip=0.3cm,rightskip=0.3cm]{structure}% \hfill\usebeamerfont{page number in head/foot}% - \if@noTotalSlides - \insertpagenumber% - \else + \if@useTotalSlideIndicator% \insertpagenumber/\insertpresentationendpage% - \fi + \else% + \insertpagenumber% + \fi% \end{beamercolorbox}% } @@ -267,11 +273,21 @@ \setbeamertemplate{frametitle}{% \nointerlineskip \begin{beamercolorbox}[wd=\paperwidth,leftskip=0.3cm,rightskip=0.3cm,ht=2.5ex,dp=1.5ex]{frametitle} -\if@protectFrameTitle - \usebeamerfont{frametitle}\protect\insertframetitle% -\else - \usebeamerfont{frametitle}\insertframetitle% -\fi +\usebeamerfont{frametitle}% +\if@protectFrameTitle% + \protect% + \if@noSmallCapitals% + \insertframetitle% + \else% + \textsc{\MakeLowercase{\insertframetitle}}% + \fi% +\else% + \if@noSmallCapitals% + \insertframetitle% + \else% + \textsc{\MakeLowercase{\insertframetitle}}% + \fi% +\fi% \end{beamercolorbox}% \if@useTitleProgressBar \vspace{-.5em}