latex分页_[LaTeX]论文算法太长老是跑到最后一页?来看看如何对算法进行分页吧...

latex分页_[LaTeX]论⽂算法太长⽼是跑到最后⼀页?来看看如
何对算法进⾏分页吧...
外文文献数据库LATEX算法过长,分页显⽰(基于爱思唯尔模板)(解决算法⽼是跑到最后⼀页的问题)_猎⼈伯爵-CSDN博客_latex中算法分页显⽰
blog.csdn
在使⽤爱思唯尔模板的时候,页⾯太⼩了,算法⽼是⼀个页⾯放不下,或者因为太⼤⽼是跑到最后⼀页。
我们可以采⽤算法分页的⽅法解决这个问题。效果如下图(原谅我的战术马赛克,论⽂还在投emmm):
这个⽅法是不会与\usepackage{algorithmic}包冲突的(我常⽤这个包)。如果使⽤的不是这个伪代码包,可能会引发冲突,可以使⽤⽹上普遍的⽅法。血管性血友病因子
采取两步⾛战略:
1.引⽤外部包+定义新环境:
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{float}
\usepackage{lipsum}
\makeatletter
\newenvironment{breakablealgorithm}
{% \begin{breakablealgorithm}
\begin{center}
\refstepcounter{algorithm}% New algorithm
\hrule height.8pt depth0pt \kern2pt% \@fs@pre for \@fs@ruled
\renewcommand{\caption}[2][\relax]{% Make a new \caption
反间谍{\raggedright\textbf{\ALG@name~\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% \@fs@post for \@fs@ruled
\end{center}
}
\makeatother
2.创建⽀持⾃动分页的伪代码块以插⼊伪代码:
\begin{breakablealgorithm}
\caption{The proposed }
\label{alg.}
\begin{algorithmic}[1]
\begin{footnotesize} %%调整算法字体⼤⼩
\STATE {//Initialization part} ............
\STATE {//Iterative part}
\REPEAT
.
...........
王牌拖拉机
\STATE {$count\Leftarrow count+1$}
\UNTIL{The given termination criterion is met.} \end{footnotesize}
非诚勿扰英国专场
\end{algorithmic}
\end{breakablealgorithm}

本文发布于:2024-09-21 01:37:55,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/432493.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议