mirror of https://github.com/matze/mtheme.git
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.
This commit is contained in:
parent
f4ddb09ad7
commit
9afeab17fe
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue