I want to use algorithm2e
to generate two procedure
and two algorithm
. The procedure
and algorithm
may be interleaved with one another, and both procedure
and algorithm
have their independent counter number.
I used the option procnumbered
to algorithm2e
so that the procedure
environment can be numbered, but I find another problem: the procedure
and algorithm
environment only share one counter number. How can I number these two environments separately, each with its own counter?
As an example, how can I number the procedure
as 1, and the algorithm
as 1 too (not 2).
Thanks.
\documentclass{article}
\usepackage[procnumbered,ruled]{algorithm2e}
\begin{document}
\begin{procedure}
\caption{myproc()}
This is a procedure
\end{procedure}
\begin{algorithm}
\caption{My algorithm}
This is a procedure
\end{algorithm}
\end{document}