I'd like to use algorithm2e package to write listing of both algorithms and heuristics. I would like to use \SetAlgorithmName
in a way that it would use separate counters for heuristics and algorithms.
So, e.g. I do:
\begin{algorithm}
\end{algorithm}
\SetAlgorithmName{Heuristics}
\begin{algorithm}
\end{algorithm}
and I get:
Algorithm 1
Heuristic 1
and not:
Algorithm 1
Heuristic 2
as currently.
Best Answer
This is an approach that works if
hyperref
is used (and also if it is not used) and sets the counter name according to the content of\algorithmcfname
and links correctly.Just define a counter, say
heuristics
and a macro\heuristicsname
which containsHeuristics
. If the counter is named foo,\fooname
must be defined as well.Update with improved setup
Use
\SetupForOtherCounter{foo}{Foo}
to define the new counter name and a new name for the environment caption.