I am trying to build my own beamer
theme for which I personalized citations. Using the seq module of the package expl3
, I have written a function that gathers all citations of a frame into a sequence which I use at the end of each frame to print all citations.
The issue is that I want to print all citations in a tcolorbox
in a footnote, however using both the expl3
\seq_map_inline:Nn
function and the footnote does not work with beamer
, I get the error
Illegal parameter number in definition of \insertfootnotetext".
Everything works fine when using the article class.
Here is a MWE:
\documentclass{beamer}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tcolorbox}
\usepackage{xparse}
\usepackage{expl3}
\usepackage{biblatex}
% My citation
\newcommand{\mycite}[1]{ \cite{#1} ~ \citeauthor{#1} ~ \citetitle{#1} ~ (\citeyear{#1})}
% List of citations
\ExplSyntaxOn
\seq_new:N \l_frame_cite_list
\NewDocumentCommand{\myAddCitation}{m}{\seq_put_right:Nn \l_frame_cite_list {#1}}
\NewDocumentCommand{\generateCitationBox}{}{
\seq_if_empty:NTF \l_frame_cite_list {} {
\seq_remove_duplicates:N \l_frame_cite_list
\footnote{
\vspace{-1em}
\begin{tcolorbox}
\seq_map_inline:Nn \l_frame_cite_list {
\mycite{##1}\\
}
\vspace{-1em}
\end{tcolorbox}
\vspace{-1em}
}
\seq_clear:N \l_frame_cite_list
}
}
\ExplSyntaxOff
\newenvironment{myframe}{\begin{frame}}{\generateCitationBox \end{frame}}
\begin{document}
\begin{myframe}
\myAddCitation{A}
\myAddCitation{B}
Hello World
\end{myframe}
\end{document}
Thank you in advance for your answers,
Simon.
\mycite{##1}
. Try with\mycite{####1}
or more.