我在算法环境中使用 for 循环,如下所示:
\begin{algorithm}
\caption{data collection}
\begin{algorithmic}[1]
\Procedure{Synthesised data}{\textit{input:} control docs}
\Procedure{Keywords extraction}{\textit{input:} control docs}
\For{doc in control docs}
extract keywords from doc and add to keywords set
\EndFor
remove duplicated keywords from keywords set
export keywords to a $txt$ file for manual filtration
\EndProcedure
\EndProcedure
\end{algorithmic}
\end{algorithm}
有什么帮助吗!
答案1
发现我\State
在每个语句的开头都缺少了什么,所以代码应该是这样的:
\Procedure{Keywords extraction}{\textit{input:} control docs}
\For{doc in control docs}
\State get indexed keywords from doc meta-data and add to keywords set
\EndFor
\State remove duplicate keywords from keywords set
\State export keywords to a $txt$ file for manual filtration
\EndProcedure