# Spurious horizontal space caused by \setbeamerfont{footnote}{...}

The following MCE points out that, even "protected" with comments, \setbeamerfont{footnote}{...} causes a spurious horizontal space.

Do you know why and how to circumvent this space?

\documentclass{beamer}
\newcommand{\mytinyfootnote}[1]{%
\setbeamerfont{footnote}{size=\tiny}%
\footnote{#1}%
}
\begin{document}
\begin{frame}
\begin{itemize}
\item Foo\mytinyfootnote{Bar}
\item Foo\footnote{Bar}
\end{itemize}
\end{frame}
\end{document}


There are spurious spaces in the definitions (imho it is not really a good idea to use \setbeamerfont in this place. Fonts should be setup in the preamble).

\documentclass{beamer}
\newcommand{\mytinyfootnote}[1]{%
\setbeamerfont{footnote}{size=\tiny}%
\footnote{#1}%
}
\makeatletter
\renewcommand\beamer@clearbeamerfont[2]{%
\def\beamer@temp{#1}%
\setkeys{beamerthm}{size={},shape={},series={},family={},parent={}}%
\setkeys{beamerthm}{#2}%
}

\renewcommand\beamer@setbeamerfont[2]{%
\def\beamer@temp{#1}%
\setkeys{beamerthm}{#2}%
}

\begin{document}
\begin{frame}
\begin{itemize}
\item  Foo\mytinyfootnote{Bar}
\item Foo\footnote{Bar}
\end{itemize}
\end{frame}
\end{document}

• I know changing the size of the footnotes in the middle of the document isn't a good practice :) Here, it is for very a special case. BTW, the spaces in the definition are removed in the beamer's development version. May 21 '17 at 20:19