Reference:
Algorithm tag and page break
The method of Latex algorithm over-length pagination display
1. Quoting algorithm
packages;
2. \begin{document}
Add the following latex code to the front:
\makeatletter\newenvironment{breakablealgorithm} {% \begin{breakablealgorithm} \begin{center} \refstepcounter{algorithm}% New algorithm \hrule height.8pt depth0pt \kern2pt% \@[email protected] for \@[email protected] \renewcommand{\caption}[2][\relax]{% Make a new \caption {\raggedright\textbf{\[email protected]~\thealgorithm} ##2\par}% \ifx\relax##1\relax % #1 is \relax \addcontentsline{loa}{algorithm}{\protect\numberline{\thealgorithm}##2}% \else % #1 is not \relax \addcontentsline{loa}{algorithm}{\protect\numberline{\thealgorithm}##1}% \fi \kern2pt\hrule\kern2pt } }{% \end{breakablealgorithm} \kern2pt\hrule\relax% \@[email protected] for \@[email protected] \end{center} }\makeatother
3. Use \begin{breakablealgorithm}
and \end{breakablealgorithm}
replace \begin{algorithm}
and \end{algorithm}
.
2017.12
The method of Latex algorithm over-length pagination display