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}