I'm trying to refer to an existing footnote inside an algorithm, and I tried following this link but it doesn't work.
I added the algorithm within a minipage so that the footnote appears soon after it.
This is the MWE:
\documentclass{article}
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor} % use color
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{arydshln} % for cdashline
\usepackage[noend]{algpseudocode}
\usepackage{algorithm}
\usepackage{algorithmicx}
\algtext*{EndWhile}% Remove "end while" text
\algtext*{EndFor}% Remove "end for" text
\algtext*{EndIf}% Remove "end if" text
\newcommand{\inlinecomment}[1]{{\color{gray} \it-- #1}}
\usepackage[colorlinks,bookmarksopen,bookmarksnumbered,citecolor=red,urlcolor=red]{hyperref}
% increase line spacing for algorithmicx
\usepackage{etoolbox}
\makeatletter
\expandafter\patchcmd\csname\string\algorithmic\endcsname{\itemsep\z@}
{\itemsep=0.2ex plus2pt}{}{}
\makeatother
% reduce font size for algorithms
\makeatletter
\renewcommand{\ALG@beginalgorithmic}
{\tt\small}
\makeatother
% redefine pseudo-code commands
\algnewcommand\algorithmicto{\textbf{to}}
%\algrenewtext{For}[3]{\algorithmicfor\ #1 $=$ #2 \algorithmicto\ #3}
\algrenewtext{While}{\textbf{while}\ }
%\algrenewtext{EndWhile}{\textbf{end}}
\algrenewtext{Procedure}[2]{\textbf{function}\ \textproc{#1}\ifthenelse{\equal{#2}{}}{}{(#2)}}
%\algrenewtext{EndProcedure}{\textbf{end}}
\newcommand*\Let[2]{\State #1 $\gets$ #2}
\algrenewcommand\algorithmicrequire{\textbf{Input:}}
\algrenewcommand\algorithmicensure{\textbf{Output:}}
\newcommand{\bs}[1] {\boldsymbol{#1}}
\begin{document}
\noindent\begin{minipage}{\textwidth}
\renewcommand\footnoterule{}
\begin{algorithm}[H]
\caption{test footnote \label{alg:assemble_t3i}}
\begin{algorithmic}[0]
\Require{Input goes here}
\Statex
\Function{BAR}{$\ldots$}
\State \inlinecomment{loop}
\For {$i \gets 1, \ldots , n$}
\Let{$ foo $\footnote{This is the footnote $\bs \xi$}}{$\text{bar} \left({\bs \xi_i }\right) $} \Comment{Here I have the first footnote}
\Let{$foo^a$}{$ \text{test} (\ldots)$} \Comment{I want to refer to the same footnote here}
\EndFor
\EndFunction
\end{algorithmic}
\end{algorithm}
\end{minipage}
\end{document}
You see that I'm cheating now since I added ^a. Is there a way to solve this?



footnoterefhas to be redefined? – aaragon Nov 22 '16 at 10:47