From f4ddb09ad75748bb972d078426a20c533d58af59 Mon Sep 17 00:00:00 2001 From: tmgriffiths Date: Thu, 16 Jul 2015 11:19:59 +1000 Subject: [PATCH 1/5] Changed beamercolorbox parameters Changes the box parameters from: leftskip=0.3cm, rightskip=0.3cm, ht=2.5ex, dp=1.5ex to: sep=1.5ex And added a strut to ensure short characters always make a minimum box height of 4.5 ex if there are small (e.g. -) characters in the title only. --- beamerouterthememetropolis.dtx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/beamerouterthememetropolis.dtx b/beamerouterthememetropolis.dtx index 8ab52f4..33f2a53 100644 --- a/beamerouterthememetropolis.dtx +++ b/beamerouterthememetropolis.dtx @@ -203,12 +203,9 @@ \nointerlineskip \begin{beamercolorbox}[% wd=\paperwidth, - leftskip=0.3cm, - rightskip=0.3cm, - ht=2.5ex, - dp=1.5ex + sep=1.5ex, ]{frametitle} - \insertframetitle% + \insertframetitle\rule{0pt}{1ex}% \end{beamercolorbox}% \vspace{\@metropolis@voffset} } @@ -216,12 +213,9 @@ \nointerlineskip \begin{beamercolorbox}[% wd=\paperwidth, - leftskip=0.3cm, - rightskip=0.3cm, - ht=2.5ex, - dp=1.5ex + sep=1.5ex, ]{frametitle} - \insertframetitle% + \insertframetitle\rule{0pt}{1ex}% \end{beamercolorbox}% \usebeamertemplate*{progress bar in head/foot} \vspace{\@metropolis@voffset} From 9afeab17fe978e9c4c9a234f5bd5ab1d2c26d42a Mon Sep 17 00:00:00 2001 From: tmgriffiths Date: Thu, 16 Jul 2015 14:07:31 +1000 Subject: [PATCH 2/5] Defined a length specific to frame title format Used the \heightof{} command from the calc package to ensure that the height used as a strut in the beamercolorbox is consistent. The height is set to the height of the tallest character of the font in a typeface independent manner, and also depending on whether the frame title is set in small caps uppercase or regular case. This ensure that the colorbox is always the height of the text plus 1.5ex above and below the text independent of format, text size, ratio and typeface. --- beamerouterthememetropolis.dtx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/beamerouterthememetropolis.dtx b/beamerouterthememetropolis.dtx index 33f2a53..a0a38d1 100644 --- a/beamerouterthememetropolis.dtx +++ b/beamerouterthememetropolis.dtx @@ -75,13 +75,18 @@ \pgfkeys{ /metropolis/outer/frametitleformat/.cd, .is choice, - regular/.code=\renewcommand{\@metropolis@frametitleformat}{}, + regular/.code={% + \renewcommand{\@metropolis@frametitleformat}{}% + \setlength{\@metropolis@frametitlestrut}{\heightof{ABCDEFGHIJKLMNOPQRSTUVXYZ}}% Usually around 1.6ex but is font dependant + }, lowercase/.code={% - \renewcommand{\@metropolis@frametitleformat}{\MakeLowercase} - }, + \renewcommand{\@metropolis@frametitleformat}{\MakeLowercase}% + \setlength{\@metropolis@frametitlestrut}{\heightof{abcdefghijklmnopqrstuvxyz}} + }, uppercase/.code={% - \renewcommand{\@metropolis@frametitleformat}{\MakeUppercase} - }, + \renewcommand{\@metropolis@frametitleformat}{\MakeUppercase}% + \setlength{\@metropolis@frametitlestrut}{\heightof{ABCDEFGHIJKLMNOPQRSTUVXYZ}}% Usually around 1.6ex but is font dependant + }, } % \end{macrocode} % \end{macro} @@ -199,13 +204,14 @@ % progress bar. % % \begin{macrocode} +\newlength{\@metropolis@frametitlestrut} \defbeamertemplate{frametitle}{plain}{% \nointerlineskip \begin{beamercolorbox}[% wd=\paperwidth, sep=1.5ex, ]{frametitle} - \insertframetitle\rule{0pt}{1ex}% + \insertframetitle\rule{0pt}{\@metropolis@frametitlestrut}% \end{beamercolorbox}% \vspace{\@metropolis@voffset} } @@ -215,7 +221,7 @@ wd=\paperwidth, sep=1.5ex, ]{frametitle} - \insertframetitle\rule{0pt}{1ex}% + \insertframetitle\rule{0pt}{\@metropolis@frametitlestrut}% \end{beamercolorbox}% \usebeamertemplate*{progress bar in head/foot} \vspace{\@metropolis@voffset} From 0a130dd39e55480757d97ef39b2ac6f209dd1782 Mon Sep 17 00:00:00 2001 From: tmgriffiths Date: Fri, 17 Jul 2015 17:16:45 +1000 Subject: [PATCH 3/5] Changed from \setlength to \renewcommand As per @rchurchley in comment thread on pull request for matze/mtheme in fix #115 --- beamerouterthememetropolis.dtx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/beamerouterthememetropolis.dtx b/beamerouterthememetropolis.dtx index a0a38d1..e18fefd 100644 --- a/beamerouterthememetropolis.dtx +++ b/beamerouterthememetropolis.dtx @@ -77,15 +77,21 @@ .is choice, regular/.code={% \renewcommand{\@metropolis@frametitleformat}{}% - \setlength{\@metropolis@frametitlestrut}{\heightof{ABCDEFGHIJKLMNOPQRSTUVXYZ}}% Usually around 1.6ex but is font dependant + \renewcommand{\@metropolis@frametitlestrut}{% + \rule{0pt}{\heightof{ABCDEFGHIJKLMNOPQRSTUVWXYZ}} + } }, lowercase/.code={% \renewcommand{\@metropolis@frametitleformat}{\MakeLowercase}% - \setlength{\@metropolis@frametitlestrut}{\heightof{abcdefghijklmnopqrstuvxyz}} + \renewcommand{\@metropolis@frametitlestrut}{% + \rule{0pt}{\heightof{abcdefghijklmnopqrstuvwxyz}} + } }, uppercase/.code={% - \renewcommand{\@metropolis@frametitleformat}{\MakeUppercase}% - \setlength{\@metropolis@frametitlestrut}{\heightof{ABCDEFGHIJKLMNOPQRSTUVXYZ}}% Usually around 1.6ex but is font dependant + \renewcommand{\@metropolis@frametitleformat}{\myletterspacing\MakeUppercase}% + \renewcommand{\@metropolis@frametitlestrut}{% + \rule{0pt}{\heightof{ABCDEFGHIJKLMNOPQRSTUVWXYZ}} + } }, } % \end{macrocode} @@ -211,7 +217,7 @@ wd=\paperwidth, sep=1.5ex, ]{frametitle} - \insertframetitle\rule{0pt}{\@metropolis@frametitlestrut}% + \insertframetitle\@metropolis@frametitlestrut% \end{beamercolorbox}% \vspace{\@metropolis@voffset} } @@ -221,7 +227,7 @@ wd=\paperwidth, sep=1.5ex, ]{frametitle} - \insertframetitle\rule{0pt}{\@metropolis@frametitlestrut}% + \insertframetitle\@metropolis@frametitlestrut% \end{beamercolorbox}% \usebeamertemplate*{progress bar in head/foot} \vspace{\@metropolis@voffset} From 17b5d914d160157fef0987a29b74822a5982526d Mon Sep 17 00:00:00 2001 From: tmgriffiths Date: Mon, 20 Jul 2015 12:39:30 +1000 Subject: [PATCH 4/5] Removed `{frametitle]{progressbar}` template. --- beamerouterthememetropolis.dtx | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/beamerouterthememetropolis.dtx b/beamerouterthememetropolis.dtx index e18fefd..9d7d522 100644 --- a/beamerouterthememetropolis.dtx +++ b/beamerouterthememetropolis.dtx @@ -219,18 +219,6 @@ ]{frametitle} \insertframetitle\@metropolis@frametitlestrut% \end{beamercolorbox}% - \vspace{\@metropolis@voffset} -} -\defbeamertemplate{frametitle}{progressbar}{% - \nointerlineskip - \begin{beamercolorbox}[% - wd=\paperwidth, - sep=1.5ex, - ]{frametitle} - \insertframetitle\@metropolis@frametitlestrut% - \end{beamercolorbox}% - \usebeamertemplate*{progress bar in head/foot} - \vspace{\@metropolis@voffset} } % \end{macrocode} % \end{macro} From c0c21bf93d235aa8eade80d6063272d6458bd257 Mon Sep 17 00:00:00 2001 From: tmgriffiths Date: Mon, 20 Jul 2015 12:51:04 +1000 Subject: [PATCH 5/5] removed \myletterspacing --- beamerouterthememetropolis.dtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beamerouterthememetropolis.dtx b/beamerouterthememetropolis.dtx index 9d7d522..56bd467 100644 --- a/beamerouterthememetropolis.dtx +++ b/beamerouterthememetropolis.dtx @@ -88,7 +88,7 @@ } }, uppercase/.code={% - \renewcommand{\@metropolis@frametitleformat}{\myletterspacing\MakeUppercase}% + \renewcommand{\@metropolis@frametitleformat}{\MakeUppercase}% \renewcommand{\@metropolis@frametitlestrut}{% \rule{0pt}{\heightof{ABCDEFGHIJKLMNOPQRSTUVWXYZ}} }