The question is advanced version of my previous one.
I need to name algorithms (package algorithmic) with arbitrary names so it appears like:
Algorithm MyAlgo
and \ref{...}
will appear like MyAlgo
.
Next code is (by cmhughes) puts A in front of a number:
\documentclass{article}
\usepackage{algorithm}
\usepackage{algpseudocode}
\renewcommand{\thealgorithm}{A\arabic{algorithm}}
\begin{document}
\begin{algorithm}
\caption{Euclid’s algorithm}
\label{alg: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$
\EndWhile\label{euclidendwhile}
\State \textbf{return} $b$\Comment{The gcd is b}
\EndProcedure
\end{algorithmic}
\end{algorithm}
Test reference: \ref{alg:euclid}
\end{document}
But how to do it for arbitrary algorithm name?
EDIT:
Maybe I was unclear in my question. What I need is assigning to algorithms
arbitrary names without numbering, so that \ref{...}
will appear as name of the
algorithm.
Best Answer
Is this what you want to achieve?