I would like to have two environments sharing a counter and appearing in the same list. One of these environments is algorithm2e and the other is a simple frame for holding algorithms I want to typeset in another way. The following code gets both environments to appear in the same list of algorithms, but their numbering doesn't match and the formatting for each line in the list of algorithms does not match.
Here is the code I have so far:
\documentclass{book}
\usepackage[lined,vlined,linesnumbered,algochapter,ruled]{algorithm2e}
\newcommand{\listofalgorithmes}{\tocfile{\listalgorithmcfname}{loa}}
\usepackage{float}
\newfloat{framealgorithm}{tbp}{loa}[chapter]
\floatname{framealgorithm}{Algorithm}
\makeatletter
\let\c@foo\c@algorithm
\renewcommand{\fnum@framealgorithm}{{\bf Algorithm~\theframealgorithm}\linespacing{1}}
\newcommand{\l@framealgorithm}{\@dottedtocline{1}{1.5em}{2.3em}}
\makeatother
\begin{document}
\listofalgorithms
\begin{algorithm}
Hello world!
\caption{Algorithm}
\end{algorithm}
\begin{framealgorithm}
Hello world from a Frame
\caption{Frame Algorithm}
\end{framealgorithm}
\end{document}
and here is the output