Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

titleformat not working correctly for section titles #371

Open
rnhmjoj opened this issue Jun 10, 2020 · 5 comments
Open

titleformat not working correctly for section titles #371

rnhmjoj opened this issue Jun 10, 2020 · 5 comments

Comments

@rnhmjoj
Copy link

rnhmjoj commented Jun 10, 2020

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.

@venkatasg
Copy link

venkatasg commented Jun 15, 2020

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.

@rnhmjoj
Copy link
Author

rnhmjoj commented Jun 15, 2020

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
Copy link

nzeh commented Nov 17, 2021

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.

@jwettig
Copy link

jwettig commented Aug 9, 2023

This is an old issue, but I also ran into it. You can redefine the beamer template for the section page in your preamble:

\makeatletter
\defbeamertemplate{section page}{newprogressbarsectionpage}{
	\centering
	\begin{minipage}{22em}
		\raggedright
		\usebeamercolor[fg]{section title}
		\usebeamerfont{section title}
		\MakeUppercase\insertsectionhead\\[-1ex]
		\usebeamertemplate*{progress bar in section page}
		\par
		\ifx\insertsubsectionhead\@empty\else%
			\usebeamercolor[fg]{subsection title}%
			\usebeamerfont{subsection title}%
			\insertsubsectionhead
		\fi
	\end{minipage}
	\par
	\vspace{\baselineskip}
}
\makeatother
\setbeamertemplate{section page}[newprogressbarsectionpage]

I just inserted \MakeUppercase in front of \insertsectionhead. For allsmallcaps I think you have to use \MakeLowercase and \scshape.

@rnhmjoj
Copy link
Author

rnhmjoj commented Aug 9, 2023

Yeah, that's what I have been doing. There is a growing pile of small issues like this one that are not getting fixed.
Someone should probably just fork this project as it seems entirely unmaintained. It's sad because metropolis is basically the only well-designed beamer theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants