可以使用\setcounter{ALG@line}{0}命令来重新设置行号起始值为1,例如:

\begin{algorithmic}[1]
  \State Do something
  \State Do something else
  \setcounter{ALG@line}{0}
  \State Do another thing
\end{algorithmic}

这样,第三行的行号将从1重新开始计数。

在latex中我使用beginalgorithmic1来进行行号计数如何让它在中间从1开始重新计数

原文地址: https://www.cveoy.top/t/topic/ey7j 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录