0

I want to write down a algorithm using TeXStudio. The algorithm is very huge so it cannot fit in one page. I use \usepackage{algorithm} ,\usepackage[noend]{algpseudocode} to write down this algorithm. I have a demo code here

\documentclass{article}
\usepackage{amsmath}
\usepackage{xcolor}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}


\begin{document}
\begin{algorithmic}
\State $i\gets 10$
\If {$i\geq 5$} 
    \State $i\gets i-1$
 \Else
  \If {$i\leq 3$}
        \State $i\gets i+2$
     \EndIf
\EndIf 
\end{algorithmic}
\end{document}

Now I want to write down

\begin{document}
\begin{algorithmic}
\State $i\gets 10$
\If {$i\geq 5$} 
    \State $i\gets i-1$
 \Else

Upto this portion in one page and rest of the portion into another page.

    \If {$i\leq 3$}
        \State $i\gets i+2$
     \EndIf
\EndIf 
\end{algorithmic}
\end{document}

This portion is in another page.

I saw various example in stack exchange which define this problem but I cannot understand how this works. So if anyone help me to divide my example into two pages it is good for me.

Thank you in advance.

Encipher
  • 548

0 Answers0