以下代码将算法中的每一行编号为<number><colon>
。有没有办法将每一行编号为<number><period>
?
\documentclass{article}
\usepackage{algorithm, algorithmic}
\begin{document}
\begin{algorithm}[H]
\caption{An algorithm}
\begin{algorithmic}[1]
\REQUIRE Input
\STATE A
\STATE B
\STATE C
\STATE D
\end{algorithmic}
\end{algorithm}
\end{document}
答案1
您可以使用以下方式调整行号分隔符
\algsetup{
linenodelimiter = {.}
}
以下是使用默认值的视觉效果.
:
\documentclass{article}
\usepackage{algorithm,algorithmic}
\begin{document}
\begin{algorithm}[H]
\caption{An algorithm}
\begin{algorithmic}[1]
\REQUIRE Input
\STATE A
\STATE B
\STATE C
\STATE D
\end{algorithmic}
\end{algorithm}
\algsetup{
linenodelimiter={.}
}
\begin{algorithm}[H]
\caption{An algorithm}
\begin{algorithmic}[1]
\REQUIRE Input
\STATE A
\STATE B
\STATE C
\STATE D
\end{algorithmic}
\end{algorithm}
\end{document}