标签:contents add doc dep bre content str break tle
1.在\begin{document}前面加入以下代码
1 \usepackage{algorithm} 2 \usepackage{algorithmic} 3 \usepackage{float} 4 \makeatletter 5 \newenvironment{breakablealgorithm} 6 {% \begin{breakablealgorithm} 7 \begin{center} 8 \refstepcounter{algorithm}% New algorithm 9 \hrule height.8pt depth0pt \kern2pt% \@fs@pre for \@fs@ruled 10 \renewcommand{\caption}[2][\relax]{% Make a new \caption 11 {\raggedright\textbf{\ALG@name~\thealgorithm} ##2\par}% 12 \ifx\relax##1\relax % #1 is \relax 13 \addcontentsline{loa}{algorithm}{\protect\numberline{\thealgorithm}##2}% 14 \else % #1 is not \relax 15 \addcontentsline{loa}{algorithm}{\protect\numberline{\thealgorithm}##1}% 16 \fi 17 \kern2pt\hrule\kern2pt 18 } 19 }{% \end{breakablealgorithm} 20 \kern2pt\hrule\relax% \@fs@post for \@fs@ruled 21 \end{center} 22 } 23 \makeatother
2.使用\begin{breakablealgorithm}和\end{breakablealgorithm}
替换 \begin{algorithm}和\end{algorithm}
标签:contents add doc dep bre content str break tle
原文地址:https://www.cnblogs.com/Advancingxq/p/10335936.html