There appears to be a conflict when I'm using the forest
package to build trees in a beamer
presentation. Whenever I use the delay
option (possibly only in combination with content
, have not used it otherwise), the following error appears:
! Illegal parameter number in definition of \beamer@doifinframe.
Despite the error, a pdf is generated on Overleaf, providing the tree I wanted, but TeXworks is not that kind to me.
What is causing the error and how to solve it?
MWE (from the forest
documentation)
\documentclass{beamer}
\usepackage{forest}
\begin{document}
\begin{frame}
\begin{forest}
[roman, delay={for children={content=\romannumeral##1}}
[1][2][3][4]
]\end{forest}
\end{frame}
\end{document}
Which renders:
fragile
and drop a#
:\begin{frame}[fragile] \begin{forest} [roman, delay={for children={content=\romannumeral#1}} [1][2][3][4] ]\end{forest} \end{frame}
fragile
, use four (!)#
:\begin{frame} \begin{forest} [roman, delay={for children={content=\romannumeral####1}} [1][2][3][4] ]\end{forest} \end{frame}
. Why four? Because three is too little and five too much. ;-)