Latex 排版报错的语句
\begin{[email protected]} on input line 927 ended by \end{algorithmic}. \end{algorithmic}
我源代码是这个样子的
\begin{algorithm}
\caption{Update Particles’s Position}
\label{alg5}
\begin{algorithmic}[1]
\STATE{ for each particlep } \\
\STATE{$a=sizeV^{t+1}_{w}(p)$ }\\
\STATE{$b=sizeW^{t}(p)$}\\
% \IF {$a=b$}
\STATE{ $W^{t+1}(p)=W^{t}(p)+V^{t+1}_{w}(p)$} \\
% \IF {$a<b$}
\STATE{$W^{t}(p)=size\_reduce(W^{t}(p)|a)$}\\
\STATE{$W^{t+1}(p)=W^{t}(p)+V^{t+1}_{w}(p)$}\\
% \Else
\STATE{$W^{t}(p)=\ size\_increase(W^{t}(p)|a)$}
\STATE{$W^{t+1}(p)=W^{t}(p)+V^{t+1}_{w}(p)$}\\
% \ENDIF
\STATE{end for}
\end{algorithmic}
\end {algorithm}
通过注解发现,影响出现这个问题的语句是if有关的语句,可以在查一下if语句的用法。
通过再次对比发现,可能是if和endif匹配的问题
参考http://www.ctan.org/pkg/algorithms 给的文献,发现是书写的问题。