I have a long algorithm that I would like to split in two pages. Something like this:
\documentclass{article}
\usepackage{algorithm}
\usepackage{algpseudocode}
\begin{document}
\begin{algorithm}
\caption{function}\label{function}
\begin{algorithmic}[1]
\Function{function}{}
\State $x \gets y$;
\While{$x < y$}
\If{$x = y$}
\State $split \gets split$; %%SPLIT HERE
\ElsIf{$x = y$}
\State $x \gets y$;
\ElsIf{$x < y$}
\State $x \gets y$;
\State $x \gets y$;
\Else
\State $x \gets y$;
\State $x \gets y$;
\EndIf
\EndWhile
\If{$x = y$}
\If{$x = y$}
\State $x \gets y$;
\ElsIf{$x = y$}
\State $x \gets y$;
\ElsIf{$x <= y$}
\State $x \gets y$;
\State $x \gets y$;
\Else
\State $x \gets y$;
\State $x \gets y$;
\EndIf
\ElsIf{$x = y$}
\State $x \gets y$;
\EndIf
\State \Return $x$
\EndFunction
\end{algorithmic}
\end{algorithm}
\end{document}
I found a solution using \algstore, however this does not work when placed in IF-ELSE structure. I have read something about \vsplit - but I am not sure how to use it to split my code.
