I am using the following code for reporting algorithms.
\usepackage{caption}
\floatstyle{ruled}
\newfloat{Algorithm}{thp}{lop}
\floatname{Algorithm}{Algorithm}
\newcommand{\listofAlgorithms}{\listof{Algorithm}{Algo List}}
.....
Here my explanation 1
\begin{Algorithm}[!ht]
\begin{verbatim}
here my algo 1
\end{verbatim}
\caption{Encrypt}
\end{Algorithm}
Here my explaination2
\begin{Algorithm}[!ht]
\begin{verbatim}
here my algo 2
\end{verbatim}
\caption{Encrypt2}
\end{Algorithm}
However sometimes the represented algorithm is not placed at the same place than in the code. What I mean is that it is going on the next page, leaving the text above.
I would like to keep the same code but with algorithms at the exact place. That is to say that breaking algorithm between would be possible 2 pages is possible. How can I do it?
Indeed, on my example, it is displayed as such on the pdf:
Here my explanation1
Here my explanation2
here my algo1
here my algo2
I do not want to refer the algorithm to a special place.
Algorithm
is just another type of float, so the above apply.\label
and\ref
).