[Tex/LaTex] Uncovered footnote appears too early in beamer presentation

beamerfootnotesoverlays

In the following code, I use \uncover<2->{\footnotetext[2]{footnote 2}} to uncover footnote 2 on the 2nd slide, along with text 2.

However, footnote 2 appears on the 1st slide (also on the 2nd slide).

How to fix it? (BWT, I want to keep the \uncover semantics; \only<2->{\footnotetext[2]{footnote 2}} is not what I want.)

beamer-footnote-overlay

\documentclass[beamer]{standalone}
\begin{document}
\begin{frame}{Footnote Overlay Tested}
  text 1~\footnotemark[1]

  \uncover<2->{text 2~\footnotemark[2]}

  \footnotetext[1]{footnote 1}
  \uncover<2->{\footnotetext[2]{footnote 2}}
\end{frame}
\end{document}

Best Answer

Edit: a much simpler solution is to not worry and just let beamer do the job:

\documentclass[beamer]{standalone}
\begin{document}
\begin{frame}{Footnote Overlay Tested}
  text 1\footnote{footnote 1}

  \uncover<2->{text 2~\footnote<2->{footnote 2}}

\end{frame}
\end{document}

Original answer: A bit hacky, but does the job:

\documentclass{beamer}

\begin{document}
\begin{frame}{Footnote Overlay Tested}
  text 1~\footnotemark[1]

  \uncover<2->{text 2~\footnotemark[2]}

  \footnotetext[1]{footnote 1}

  \alt<1>{\let\thefootnote\relax\footnotetext{~}}{\footnotetext[2]{footnote 2}}
\end{frame}
\end{document}

enter image description here