Using beamer with the mtheme, I want to have a global transition effect (a fast fade) which I set using the following code:

\addtobeamertemplate{background canvas}{\transfade[duration=0.2]}{}

as found on this answer.

However, doing it messes up with my slides settings. It doesn't change every slides, only the \section ones that are slightly shifted to the right, adding a white line on the left, as seen here: Ugly white shift on the left of the slide

I tried using XeLaTeX and LuaLaTeX, as they are the only compilers I could use for my current font, but they both have the same issue.

It probably comes from the theme, however I have no clue why it would happen or how to fix it.

Edit : MWE

\documentclass{beamer}
\usetheme{m}
\addtobeamertemplate{background canvas}{\transfade}{}

\begin{document}
\section{test}
\end{document}

Requires the mtheme to work

  • 1
    Welcome to TeX.SX! Please help us (and also you) and add a minimal working example (MWE), that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass and ending with \end{document}. – Bobyandbob Jun 15 '17 at 9:30
  • I just added the MWE, as you can see it is really just about adding the \transfade. – Varpie Jun 15 '17 at 9:45
  • 2
    From the link to GitHub that you provide: IMPORTANT NOTICES FOR VERSION 1.0 The package and theme name changed from **m** to **metropolis**! – Dr. Manuel Kuehner Jun 15 '17 at 9:54
  • 2
    Same happens with default theme and a background color, so it's not a mtheme problem. As Joseph Wright said in cited question, what you want is not possible and the proposed workaround is just a workaround that doesn't work on all situations. – Ignasi Jun 15 '17 at 9:55
  • 1
    By the way, metropolis theme is already in CTAN: ctan.org/pkg/beamertheme-metropolis – Ignasi Jun 15 '17 at 9:58
up vote 2 down vote accepted

The source of the problem is a missing % in the beamer definition of

\newcommand\beamer@dotrans[2][]{%
  \def\beamer@transdir{}%
  \def\beamer@dur{}%
  \setkeys{beamertrans}{#1}%
  \edef\beamer@temp{{pdfpagetransition={#2 \beamer@transdir\space\beamer@dur}}}% <- This one is missing
  \expandafter\hypersetup\beamer@temp}

(this had been fixed in https://github.com/josephwright/beamer/commit/b7a4383535e9b534c822fdbe039369ce6044724f)


A quick workaround: add your transition at the end of the background canvas template, not at the begin:

\documentclass{beamer}
\usetheme[background=dark]{metropolis}

\addtobeamertemplate{background canvas}{}{\transdissolve[duration=0.2]}

\begin{document}

\begin{frame}
content...
\end{frame}

\section{test}

\begin{frame}
content...
\end{frame}
\end{document}

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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