add subtitles

This commit is contained in:
Mylloon 2023-06-01 19:33:44 +02:00
parent 71b96da8ee
commit 4e1fd95271
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -69,3 +69,48 @@
% Pas de préfix pour les figures
\RequirePackage[figurename=]{caption}
% Support des sous-titres
\makeatletter
\newcommand\startsubtitle{
\renewcommand{\metropolis@frametitlestrut@start}{
\rule{0pt}{1ex +
\totalheightof{
\ifcsdef{metropolis@frametitleformat}{\metropolis@frametitleformat X}{X}
}
}
}
\renewcommand{\metropolis@frametitlestrut@end}{
\rule[-3ex]{0pt}{\metropolis@frametitle@padding}
}
}
\newcommand\stopsubtitle{
\renewcommand{\metropolis@frametitlestrut@start}{
\rule{0pt}{\metropolis@frametitle@padding +
\totalheightof{
\ifcsdef{metropolis@frametitleformat}{\metropolis@frametitleformat X}{X}
}
}
}
\renewcommand{\metropolis@frametitlestrut@end}{
\rule[-\metropolis@frametitle@padding]{0pt}{\metropolis@frametitle@padding}
}
}
\makeatother
\setbeamercolor{framesubtitle}{fg=white}
\setbeamerfont{framesubtitle}{series=\mdseries}
\addtobeamertemplate{frametitle}{
\ifx\insertframesubtitle\empty\else
\startsubtitle
\fi
}{
\ifx\insertframesubtitle\empty\else
\vspace{-4ex}
\usebeamerfont{framesubtitle}
\usebeamercolor[fg]{framesubtitle}
\insertframesubtitle
\stopsubtitle
\fi
}