[Tex/LaTex] Beamer: Footnote appears twice when used in a frame title

beamer

I am trying to insert a footnote on a beamer slide, using a customized template provided by a third party.
This simple code:

\begin{frame}
\frametitle{Something\footnote[frame]{text goes here}}

\end{frame}

produces two (?!) footnotes, as shown here

I tried alternatively to use \footnotemark and \footnotetext, and in that case the footnote text does not appear at all on the slide, only the mark.

This behavior is specific to footnote associated with a frame title, otherwise it works normally – only one footnote appears.
Is there a way to make footnote work inside the title?

Best Answer

The problem is, that your template was using \insertframetitle two times, once inside a savebox, which was then used to measure the size, and then once more when the frametitle was actually inserted. One solution could be to simply reuse the savebox when the frametitle is inserted:

\documentclass{beamer}


\usetheme[fontPath=Fonts/, imagesPath=Images/, titleHeight=1.45cm]{IMT}
\title{A title for the presentation}
\subtitle{A subtitle}
\author{An author}
\date{\today}

\usepackage[english]{babel}
%\usepackage{geometry}
\geometry{paperwidth=\the\paperwidth,   paperheight=\the\paperheight,   hmargin=1cm,   vmargin=0cm,   head=0cm, headsep=0pt,foot=0cm}
\makeindex

\makeatletter
\setbeamertemplate{frametitle}%
{\newcommand*{\stilltodo}{T}
\newcommand{\mytrue}{T}
\ForEachX
{,}
{
\ifthenelse{\equal{\stilltodo}{T}}{%
    \savebox{\titlebox}{
        \ifblue%
            \begin{beamercolorbox}[wd=\twidth,center]{title in head/foot}
                \usebeamerfont*{frametitle}\thislevelitem\setstretch{.9}\insertframetitle%
            \end{beamercolorbox}
        \else%
            \begin{beamercolorbox}[wd=\twidth,center]{}
                \usebeamerfont*{frametitle}\thislevelitem\setstretch{.9}\insertframetitle%
            \end{beamercolorbox}
        \fi%
        }

    \ifthenelse{\titleheight > \ht\titlebox}{%
        \renewcommand{\stilltodo}{F}%
        \setlength{\titlemargin}{\titleheight}%
        \addtolength{\titlemargin}{-\ht\titlebox}%

        \vspace*{-\titleheight}%

        \nointerlineskip

        \begin{beamercolorbox}[wd=\textwidth,ht=.5\titlemargin,center]{}\end{beamercolorbox}

        \nointerlineskip

        \hfill\usebox{\titlebox} % NEW !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

%       \ifblue
%       \hfill%
%       \begin{beamercolorbox}[wd=\twidth,ht=\ht\titlebox,center, dp=0cm]{title in head/foot}
%       \usebeamerfont*{frametitle}\thislevelitem\setstretch{.9}\insertframetitle
%       \end{beamercolorbox}
%       \else
%       \hfill%
%       \begin{beamercolorbox}[wd=\twidth,ht=\ht\titlebox,center, dp=0cm]{}
%       \usebeamerfont*{frametitle}\thislevelitem\setstretch{.9}\insertframetitle
%       \end{beamercolorbox}
%       \fi


    }{}
}{}
}
{\LARGE,\Large,\large,\normalsize,\small,\footnotesize}
}
\makeatother


\begin{document}

\section{A Section}
\begin{frame}
\frametitle{Something\footnote[frame]{text goes here}}

\end{frame}



\end{document}
Related Question