matze/mtheme

titleformat not working correctly for section titles

rnhmjoj opened this issue · 5 comments

Issue description

The option titleformat=allcaps or titleformat section=allcaps doesn't seem to affect the format of section titles, while frame titles, the main title, etc. works.

I have tried either passing these options to the \usetheme or by \metroset.

Trying to reproduce

Minimal code to reproduce the issue

\documentclass{beamer}

\usetheme[titleformat=allcaps]{metropolis}
\begin{document}
\section{Introduction}
\begin{frame}{Metropolis}
\end{frame}
\end{document}

Software tried:

  • TeX distribution: texlive 2019
  • engine: either xelatex or pdflatex

Additional notes

Strangely titleformat=smallcaps do work for section titles, but not titleformat=allsmallcaps.

What exactly is the output for the minimal code, and what is it that you want it to produce?

If you want allsmallcaps, you need to ensure that your section text is all lowercase as well. For example, {Introduction} in your MWE should be {introduction} if you want it to be displayed all small caps. Not sure if this is a bug, because the frame titles don't have this issue.

What exactly is the output for the minimal code, and what is it that you want it to produce?

The output is "Introduction", while I expected "INTRODUCTION"

If you want allsmallcaps, you need to ensure that your section text is all lowercase as well.

Ok, I didn't know this but I'm only interested in the allcaps format.

nzeh commented

I just ran into this, too. I thinkered around a little bit, using the simple introductory example provided in the README. It seems that \metropolis@sectiontitleformat (which is in charge of implementing the conversion to all caps) is completely ignored. I tested this by manually overriding this command to add a prefix to every section title, and nothing happened.

I suspect that the problem may be the surgery that this theme does with the \beamer@section command. This used \patchcmd, which does simple pattern search and replacement in the definition of the command to be patched. If the definition of \beamer@section has changed in the Beamer class, then the pattern the Metropolis theme looks for may not exist. However, the log shows no error that patching failed, so I'm still a bit baffled.