1

Using this answer I have added my university logo to the frame title of my beamer slides I made using the Metropolis theme. MWE:

\documentclass[9pt,aspectratio=169,]{beamer}
\usetheme[progressbar=frametitle,
subsectionpage=progressbar,
block=fill]{Metropolis}
\usepackage[export]{adjustbox}

\makeatletter
\setlength{\metropolis@frametitle@padding}{1.8ex}% <- default 2.2 ex
\setbeamertemplate{frametitle}{%
    \nointerlineskip%
    \begin{beamercolorbox}[%
        wd=\paperwidth,%
        sep=0pt,%
        leftskip=\metropolis@frametitle@padding,%
        rightskip=\metropolis@frametitle@padding,%
        ]{frametitle}%
        \metropolis@frametitlestrut@start%
        \insertframetitle%
        \nolinebreak%
        \metropolis@frametitlestrut@end%
        \hfill
        \includegraphics[height=3ex,keepaspectratio,valign=c]{example-image}
    \end{beamercolorbox}
}

\begin{document}

\begin{frame}
\frametitle{Frame title}
Contents...
\end{frame}

\end{document}

But now I have no progress bar below the frame title anymore. I tried to add it back in with code from the Metropolis manual, but was unsuccessful. Any help is appreciated. Thanks!

Output

1

You can add \usebeamertemplate*{progress bar in head/foot} at the end of your custom frametitle definition:

\documentclass[9pt,aspectratio=169,]{beamer}
\usetheme[progressbar=frametitle,
subsectionpage=progressbar,
block=fill]{metropolis}
\usepackage[export]{adjustbox}

\makeatletter
\setlength{\metropolis@frametitle@padding}{1.8ex}% <- default 2.2 ex
\setbeamertemplate{frametitle}{%
    \nointerlineskip%
    \begin{beamercolorbox}[%
        wd=\paperwidth,%
        sep=0pt,%
        leftskip=\metropolis@frametitle@padding,%
        rightskip=\metropolis@frametitle@padding,%
        ]{frametitle}%
        \metropolis@frametitlestrut@start%
        \insertframetitle%
        \nolinebreak%
        \metropolis@frametitlestrut@end%
        \hfill
        \includegraphics[height=3ex,keepaspectratio,valign=c]{example-image}
    \end{beamercolorbox}
    \usebeamertemplate*{progress bar in head/foot}
}

\setlength{\metropolis@progressinheadfoot@linewidth}{3pt}% just to better see that it's working


\begin{document}

\begin{frame}
\frametitle{Frame title}
Contents...
\end{frame}

\begin{frame}
\frametitle{Frame title}
Contents...
\end{frame}

\begin{frame}
\frametitle{Frame title}
Contents...
\end{frame}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.