I am using beamer
with metropolis
theme.
According to manual (page 6) metropolis
offers option for background, namely dark
and light
, which can be set anytime, i.e. even mid-presentation, with the \metroset
macro.
As expected, setting \metroset{background=dark}
in preamble results in dark background and light normal text
.
However, using \metroset{background=dark}
in mid-document does not work as expected. The \metroset{background=dark}
indeed sets the background of next slide to dark, but does not change the color of the normal text
from dark
to light
. Hence, the text on dark background is invisible.
\documentclass{beamer}
\usetheme[progressbar=frametitle,block=fill]{metropolis}
\begin{document}
\begin{frame}{Light Theme}
Hello, world!
\end{frame}
\metroset{background=dark} % change background theme according to manual
\begin{frame}{Dark Theme}
Hello, world! % invisible
\end{frame}
\end{document}
Best Answer
The theme doesn't take sufficient account of the way Beamer's colours work. In particular, when you change the colour, the code uses
\setbeamercolor
but not\usebeamercolor
, which is necessary for the change to take effect.For example, the following works.
Should you run into any weird spacing issues when using this theme, consider the possibility that it is introducing spurious spaces as the code suggests it may be quite keen to do so.
For things to work as expected, you could redefine the commands as follows.