I am writing a few rather large pseudocode functions using algorithm
and algorithmic
, i.e. my code looks something like:
\begin{algorithm}
\caption{Coolest Algorithm ever}
\label{findme}
\begin{algorithmic} [1] % enter the algorithmic environment
\REQUIRE Here are a few variables \\
variable 2 \\
variable 3
\ENSURE this is the output \\
output 2
\STATE $some cool code here$
\STATE $some cool code here$
\STATE $some cool code here$
\STATE $some cool code here$
\end{algorithmic}
\end{algorithm}
Unfortunately this code does not fit on one page and I am definitely not able to split it into some subfunctions or so (I already did that as far as possible).
So now I need to split up the algorithm into two pages, but I have no idea how.
The easiest way I can imagine is just to start a new algorithm on the new page, but this time letting the line counter start at line 35 or so instead of 1. But how can I do that?
Please not that there is already a similar question here on this site, but it deals with the package algorithmicx
.
Best Answer
You should use the algorithmicx package instead and its
\algstore
and\algrestore
commands. If you don't want to rewrite all youralgorithmic
algorithms, you can still usealgorithmicx
either by loading thealgpseudocode
package with thecompatible
option, or by loading thealgcompatible
package: