From 122e9f48ba0c2eb5b0b6b39e7bd72a502b5e76d3 Mon Sep 17 00:00:00 2001 From: Benjamin Weiss Date: Fri, 26 Feb 2016 19:31:25 +0100 Subject: [PATCH 1/2] new frame title struts --- source/beamerouterthememetropolis.dtx | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/source/beamerouterthememetropolis.dtx b/source/beamerouterthememetropolis.dtx index 53954fa..9f0dcdb 100644 --- a/source/beamerouterthememetropolis.dtx +++ b/source/beamerouterthememetropolis.dtx @@ -154,16 +154,31 @@ % Templates for the frame title, which is optionally underlined with a % progress bar. % \begin{macrocode} -\newcommand{\metropolis@frametitlestrut}{ - \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()}% +\newlength{\metropolis@frametitle@padding} +\setlength{\metropolis@frametitle@padding}{1.5ex} +\newcommand{\metropolis@frametitlestrut@start}{ + \rule{0pt}{\metropolis@frametitle@padding +% + \totalheightof{% + \ifcsname metropolis@frametitleformat\endcsname% + \metropolis@frametitleformat X% + \else% + X% + \fi% + }% + }% +} +\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} From 6c2f5dd4aedaf74d052b82b483fdf3e7688d8a04 Mon Sep 17 00:00:00 2001 From: Benjamin Weiss Date: Sun, 28 Feb 2016 12:16:26 +0100 Subject: [PATCH 2/2] use etoolbox for if statement --- source/beamerouterthememetropolis.dtx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/source/beamerouterthememetropolis.dtx b/source/beamerouterthememetropolis.dtx index 9f0dcdb..631bf81 100644 --- a/source/beamerouterthememetropolis.dtx +++ b/source/beamerouterthememetropolis.dtx @@ -159,11 +159,7 @@ \newcommand{\metropolis@frametitlestrut@start}{ \rule{0pt}{\metropolis@frametitle@padding +% \totalheightof{% - \ifcsname metropolis@frametitleformat\endcsname% - \metropolis@frametitleformat X% - \else% - X% - \fi% + \ifcsdef{metropolis@frametitleformat}{\metropolis@frametitleformat X}{X}% }% }% }