I am trying to define a new environment that uses the algorithm
environment from algorithm2e
. I want to use a separate caption counter for this new environment. As of now, this is what I have, but I don't know how to \def
or \renewcommand
the caption variable with the hdps
counter?
\newcounter{hdps}
\newenvironment{asm}{%
\stepcounter{hdps}%
\renewcommand*{\algorithmcfname}{ASM Spec.}%
\begin{algorithm}}
{%
\def\thealgocf{}%
\end{algorithm}}
Help is much appreciated.
Best Answer
You could use something like this:
EDIT: of course, this approach will only work as expected if
\caption
is used consistently in thealgorithm
andasm
environments.