无法在我的算法中获取行号

无法在我的算法中获取行号

我使用算法包编写了此代码,我想在算法中添加行号。

\begin{algorithm}
\caption{Owen Control Sampling algorithm}\label{alg:cap}
\begin{algorithmic}[1]
... 
\end{algorithmic}
\end{algorithm}

对此,我得到的只是算法每一行前面的 0:。请建议该怎么办?

答案1

我刚刚尝试过:

\begin{algorithm}
\caption{Owen Control Sampling algorithm}\label{alg:cap}
\begin{algorithmic}[1]
\STATE $N \Leftarrow -n$
\STATE $N \Leftarrow -n$
\end{algorithmic}
\end{algorithm}

并获得两行编号良好的行。我猜你的例子应该很详细。(一个最小的编号错误的例子)

相关内容