General ⇒ footnote when dealing with algorithms
-
- Posts: 30
- Joined: Fri Nov 23, 2007 12:56 am
footnote when dealing with algorithms
I am just wondering how can I add a footnote inside the algorithm (using the algorithm package) next to the comments, I tried to add it but it gave me a number next to the sentence, but at the bottom of the page nothing has been shown to indicate the description of the footnote.
Thanks,
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
footnote when dealing with algorithms
Code: Select all
\documentclass{article}
\usepackage{algpseudocode,algorithm}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{algorithm}[t]
\caption{Euclid’s algorithm}\label{euclid}
\begin{algorithmic}[1]
\Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b}
\State $r\gets a\bmod b$
\While{$r\not=0$}\Comment{We have the answer if r is 0}
\State $a\gets b$
\State $b\gets r$
\State $r\gets a\bmod b$\footnotemark
\EndWhile\label{euclidendwhile}
\State \textbf{return} $b$\Comment{The gcd is b}
\EndProcedure
\end{algorithmic}
\end{algorithm}
\footnotetext{A footnote about the statement $r\gets a\bmod b$.}
\lipsum[2]
\end{document}