Disable the numbering of algorithms
posting working examples would be a nice idea ... ;-) Now only page references make sense:
\documentclass{article}
\usepackage[noend]{algorithmic}
\usepackage{algorithm,caption}
\algsetup{indent=2em}
\renewcommand{\algorithmiccomment}[1]{\hspace{2em}// #1}
\begin{document}
\begin{algorithm}
\caption*{MyAlgorithm} \label{alg:MyAlgorithm}
\begin{algorithmic}[1]
\item foo
\end{algorithmic}
\end{algorithm}
see algorithm on Page~\pageref{alg:MyAlgorithm}
\end{document}
Setting the counter to nothing also works fine
\renewcommand{\thealgorithm}{}
The algorithm name and number are set as a combination. In general this is inside the "float macro" called \fnum@<float>
. In the case of algorithm
we see this definition for \fnum@algorithm
:
> \fnum@algorithm=macro:
->\fname@algorithm {} \thealgorithm .
We can redefine this to only use \fname@algorithm
(and therefore drop \thealgorithm
- the algorithm numbering):
\documentclass{article}
\usepackage{algorithm,algpseudocode}
\makeatletter
\renewcommand{\fnum@algorithm}{\fname@algorithm}
\makeatother
\begin{document}
\begin{algorithm}
\caption{MyAlgorithm}
\begin{algorithmic}[1]
\State An item
\end{algorithmic}
\end{algorithm}
\end{document}
A similar interface/option is provided using the caption
package:
\usepackage{caption}
\DeclareCaptionLabelFormat{algnonumber}{Algorithm}
\captionsetup[algorithm]{labelformat=algnonumber}