18

I am trying to write some heuristics for a problem using the algorithm2e package.

However as you may know, when you write :

\begin{algorithm}
\caption{Heuristic 1: Name of Heuristic}
 ...
\end{algorithm}

The output says


Algorithm 1: Heuristic 1: Name of Heuristic


Do someone know how do I get it to write:


Heuristic 1: Name of Heuristic


instead ?

PS. I don't know if this command does the trick: \SetAlgoRefName{} I could not get it to work, anyone has an example where they used it?

Related topics are:

In different packages:

1 Answer 1

25

\SetAlgorithmName requires three arguments:

\SetAlgorithmName{algorithmname}{algorithmautorefname}{list of algorithms name}

such as

\SetAlgorithmName{Heuristic}{heuristic}{List of Heuristics}

You could also directly redefine the macros of the algorithm2e package:

\renewcommand*{\listalgorithmcfname}{List of Heuristics}
\renewcommand*{\algorithmcfname}{Heuristic}
\renewcommand*{\algorithmautorefname}{heuristic}
5
  • Hurray! Actually I did not have the right version of algorithm2e at the office. That was why it did not work. Please accept my apologies for making you waste your time. Thanks anyway!
    – Gopi
    Jul 6, 2011 at 19:23
  • Thank you for this great answer! But when I try to search the keywork listalgorithmcfname, algorithmcfname and algorithmautorefname for a deeper understanding, I can't get any satisfying references, even in the algorithm2e.sty manual. Could you point out any good explanation references for these keywords?
    – YaOzI
    Apr 30, 2015 at 11:38
  • Why are there still numbers
    – JoseOrtiz3
    Dec 10, 2019 at 17:34
  • 1
    How did you discover this? I search the docs but no luck.
    – caveman
    Jan 11, 2021 at 13:39
  • 1
    @caveman It's nearly 10 years ago, but I guess I looked into the source code.
    – Stefan Kottwitz
    Jan 11, 2021 at 15:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .