# How to avoid printing the algorithm number in algorithm captions?

I am using the algorithm2e package to write algorithms. However, when i write three algorithms one after another, the algorithms are automatically numbered 1,2 and 3 in the caption. I am using following code:

\begin{algorithm}[H]
\SetAlgoLined
\KwData{this text}
\KwResult{how to write algorithm with \LaTeX2e }
initialization\;
\While{not at end of this document}{
\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
go back to the beginning of current section\;
}
}
\caption{How to write algorithms}
\end{algorithm}


I am getting the resulting algorithm to be

The caption of algorithm mentions "Algorithm 3" if this package is used three times. I want that for every caption it just mentions "Algorithm" and not "Algorithm 3". How can it be done?

-
–  texenthusiast May 18 '13 at 8:15
Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. –  Jubobs Dec 6 '14 at 20:08

If you're willing to use \TitleOfAlgo instead (which, for algorithms, is more flexible than \caption in many ways), then see John Wickerson's answer.

Otherwise, if you really want to use \caption but remove algorithm numbering, simply insert \renewcommand{\thealgocf}{} in your preamble.

\documentclass[10pt]{report}
\usepackage{algorithm2e}

\renewcommand{\thealgocf}{}

\begin{document}

\begin{algorithm}[H]
\SetAlgoLined
\KwData{this text}
\KwResult{how to write algorithm with \LaTeX2e }
initialization\;
\While{not at end of this document}{
\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
go back to the beginning of current section\;
}
}
\caption{How to write algorithms}
\end{algorithm}

\end{document}

-
if answered, then DO accept it as an answer please. –  doctorate Feb 11 '14 at 16:20
\renewcommand{\thealgocf}{} works for me –  wannik May 16 at 16:43

As texenthusiast has pointed out in a comment below, you should use

\TitleOfAlgo{How to write algorithms}


rather than

\caption{How to write algorithms}


This makes algorithms not numbered by default. If you change your mind and want the algorithms to be numbered again, you should set the option titlenumbered option when you load the algorithm2e package. (titlenotnumbered is the default.) That is,

\usepackage[titlenumbered]{algorithm2e}


For more details, see page 20 of the package documentation.

-
titlenotnumbered is (default) hence not needed to mention but should use \TitleOfAlgo{How to write algorithms} instead of \caption{How to write algorithms} to remove numbering. –  texenthusiast May 18 '13 at 8:04