伪代码跨页显示
Posted advancingxq
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了伪代码跨页显示相关的知识,希望对你有一定的参考价值。
1.在egin{document}前面加入以下代码
1 usepackage{algorithm} 2 usepackage{algorithmic} 3 usepackage{float} 4 makeatletter 5 ewenvironment{breakablealgorithm} 6 {% egin{breakablealgorithm} 7 egin{center} 8 efstepcounter{algorithm}% New algorithm 9 hrule height.8pt depth0pt kern2pt% @[email protected] for @[email protected] 10 enewcommand{caption}[2][ elax]{% Make a new caption 11 { aggedright extbf{[email protected]~ healgorithm} ##2par}% 12 ifx elax##1 elax % #1 is elax 13 addcontentsline{loa}{algorithm}{protect umberline{ healgorithm}##2}% 14 else % #1 is not elax 15 addcontentsline{loa}{algorithm}{protect umberline{ healgorithm}##1}% 16 fi 17 kern2pthrulekern2pt 18 } 19 }{% end{breakablealgorithm} 20 kern2pthrule elax% @[email protected] for @[email protected] 21 end{center} 22 } 23 makeatother
2.使用egin{breakablealgorithm}和end{breakablealgorithm}
替换 egin{algorithm}和end{algorithm}
以上是关于伪代码跨页显示的主要内容,如果未能解决你的问题,请参考以下文章