beamer
beamer copied to clipboard
\defbeamertemplatealias does not work with parent templates
MWE
\documentclass{beamer}
% should behave the same as \setbeamertemplate{items}[square]
\defbeamertemplatealias{items}{custom}{square}
\setbeamertemplate{items}[custom]
\begin{document}
\begin{frame}
\begin{itemize}
\item Hello World!
\end{itemize}
\end{frame}
\end{document}
Expected Result
Itemize items are rendered as small squares
Observed Result
Itemize items are rendered as triangles (the default)
Environment
TeXLive 2022 with beamer v3.67
It seems to work with the actual beamer template instead of the template parent:
\documentclass{beamer}
\defbeamertemplatealias{itemize item}{custom}{square}
\setbeamertemplate{itemize item}[custom]
\begin{document}
\begin{frame}
\begin{itemize}
\item Hello World!
\end{itemize}
\end{frame}
\end{document}
It seems to work with the actual beamer template instead of the template parent
You're right: it does work when used with actual beamer templates instead of parent templates. I'm going to update the issue title accordingly.
One possible workaround would be defining aliases for every child template which is not a parent template itself. The following code does work:
\documentclass{beamer}
% \defbeamertemplatealias{itemize items}{custom}{square} % don't uncomment -- or it will break
\defbeamertemplatealias{itemize item}{custom}{square}
\defbeamertemplatealias{itemize subitem}{custom}{square}
\defbeamertemplatealias{itemize subsubitem}{custom}{square}
% ... also define aliases for enumerate [sub[sub]]item ...
\setbeamertemplate{items}[custom]
\begin{document}
\begin{frame}
\begin{itemize}
\item Hello World!
\begin{itemize}
\item Hello World!
\begin{itemize}
\item Hello World!
\end{itemize}
\end{itemize}
\end{itemize}
\end{frame}
\end{document}