From f4ddb09ad75748bb972d078426a20c533d58af59 Mon Sep 17 00:00:00 2001 From: tmgriffiths Date: Thu, 16 Jul 2015 11:19:59 +1000 Subject: [PATCH 1/7] 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/7] 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/7] 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/7] 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/7] 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}} } From 927e5e44365ae9286c184caad5b5dbe458f82118 Mon Sep 17 00:00:00 2001 From: tmgriffiths Date: Mon, 20 Jul 2015 13:11:42 +1000 Subject: [PATCH 6/7] Added a second \@metropolis@frametitlestrut MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I’ve put a `\@metropolis@frametitlestrut` at the beginning and the end because of what I can see will be an error for multiline titles. Perhaps what @benjamin-weiss was alluding too? If we were to put the strut at the end of a multiline title, then if the first line was nothing but lower case characters (for some reason…) in a `frametitleformat=regular` situation then the strut would make sure that the minimum height would still be that of a capital letter. But, since this is a multiline title that only happens for the last line. If we thing of the opposite situation; the strut is at the beginning but our final line is nothing but lowercase. Then the strut again makes sure that the minimum height is that of a capital letter. But, this is only applied to the first line now. To rectify this I’ve put a strut at both the beginning and the end. Now, this won’t help If the presenter has a multiline title that is three or more lines long (god forbid) but in that case the standard leading and `\baselinskip` should take care of it. Also, the central line(s) shouldn’t effect the padding around the title anyway. --- beamerouterthememetropolis.dtx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beamerouterthememetropolis.dtx b/beamerouterthememetropolis.dtx index 606bcdf..5dde47b 100644 --- a/beamerouterthememetropolis.dtx +++ b/beamerouterthememetropolis.dtx @@ -201,7 +201,7 @@ wd=\paperwidth, sep=1.5ex, ]{frametitle} - \insertframetitle\@metropolis@frametitlestrut% + \@metropolis@frametitlestrut\insertframetitle\@metropolis@frametitlestrut% \end{beamercolorbox}% } % \end{macrocode} From 6602d5b13ae60dfe764213efcf6964c22f3c50ae Mon Sep 17 00:00:00 2001 From: tmgriffiths Date: Tue, 21 Jul 2015 11:24:05 +1000 Subject: [PATCH 7/7] =?UTF-8?q?Here=E2=80=99s=20some=20%=E2=80=99s.=20Merg?= =?UTF-8?q?e=20me.=20Maybe=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beamerouterthememetropolis.dtx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/beamerouterthememetropolis.dtx b/beamerouterthememetropolis.dtx index 5dde47b..f46bf6f 100644 --- a/beamerouterthememetropolis.dtx +++ b/beamerouterthememetropolis.dtx @@ -196,11 +196,11 @@ % \begin{macrocode} \newlength{\@metropolis@frametitlestrut} \defbeamertemplate{frametitle}{plain}{% - \nointerlineskip + \nointerlineskip% \begin{beamercolorbox}[% - wd=\paperwidth, - sep=1.5ex, - ]{frametitle} + wd=\paperwidth,% + sep=1.5ex,% + ]{frametitle}% \@metropolis@frametitlestrut\insertframetitle\@metropolis@frametitlestrut% \end{beamercolorbox}% }