2

I wrote an algorithm but it is long and it can't fit in one page but my problem is that it doesn't split into two page .. what happen is that a part of the algorithm appears in the first page and the rest disappears as shown in the figure below .. any solution?

enter image description here

and this is the code of the algorithm:

\begin{algorithm}
\caption{Calculating Score}\label{euclid}
\begin{algorithmic}[1]
\Procedure{CheckBetaamplitude}{}
\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(1) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(2) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(3) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(4) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(5) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(6) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(7) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(8) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(9) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(10) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(11) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(12) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(13) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(14) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(15) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(16) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(17) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(18) \gets n/length()$

\State $i \gets find(absolute()<maxamp)$
\State $n \gets length(i)$
\State $s(19) \gets n/length()$


\State $score4 \gets Average(s)$
\EndProcedure
\end{algorithmic}
\end{algorithm}
4
  • To me this algorithm looks like a loop: for (j = 1; j < 20; ++j) { i = find(absolute()<maxamp); n = length(i); s(j) = n/length() } score4 = Average(s); Of course this doesn't answer your question, but would resolve the problem.
    – Ronald
    Commented Oct 22, 2014 at 13:54
  • Thanks for your comment but it doesn't work as I didn't add the parameter of the functions .. which is different in each line.
    – SMH
    Commented Oct 22, 2014 at 22:12
  • Related? tex.stackexchange.com/questions/29816/algorithm-over-2-pages
    – user13907
    Commented Oct 23, 2014 at 1:27
  • Can I have the complete MWE?
    – hola
    Commented Jun 6, 2019 at 16:02

1 Answer 1

4

here you go :)

\begin{algorithm}
    \caption{Calculating Score}\label{euclid}
    \begin{algorithmic}[1]
    \Procedure{CheckBetaamplitude}{}
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(1) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(2) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(3) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(4) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(5) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(6) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(7) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(8) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(9) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(10) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(11) \gets n/length()$
    \EndProcedure
    \algstore{myalg}
    \end{algorithmic}
    \end{algorithm}
    \begin{algorithm}                     
    \begin{algorithmic} [1]              
    \algrestore{myalg}
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(12) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(13) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(14) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(15) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(16) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(17) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(18) \gets n/length()$
    \State $i \gets find(absolute()<maxamp)$
    \State $n \gets length(i)$
    \State $s(19) \gets n/length()$
    \State $score4 \gets Average(s)$
    \end{algorithmic}
    \end{algorithm}
1
  • Hello, in this I face a problem that the text that is written after it goes in front . How to get rid of it. Commented Jun 6, 2021 at 16:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .