2021 年 6 月 13 日更新 miktex 后算法包出现 Latex 错误

2021 年 6 月 13 日更新 miktex 后算法包出现 Latex 错误
! Extra }, or forgotten \endgroup.
\endalgorithm ...nalty }\@Esphack \fi \fi \egroup 
                                                  
l.23 \end{algorithm}
                
I've deleted a group-closing symbol because it seems to be
spurious, as in `'$x}$'`. But perhaps the `}` is legitimate and
you forgot something else, as in `\hbox{$x}`. In such cases
the way to recover is to insert both the forgotten and the
deleted material, e.g., by typing `'I$}'`.


! LaTeX Error: \begin{algorithm} on input line 9 ended by \end{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.26 \end{document}

女士:

\documentclass[10pt, a4paper]{article}
\usepackage{algorithm}
\usepackage{algpseudocode}   
%---------------------------------------------------------------------------
\begin{document}

bla bla bla

\begin{algorithm}
    \caption{Função Métrica para o BRKGA}
    \label{alg:metric}
    \begin{algorithmic}[1]
        \State $\mathit{\textbf{Metrica}( \alpha, \beta , cromos, peso\_min)}$
        \State $MomInicio \gets CalcularInicio(cromos)$;
        \State $Antec \gets calcAntecip(cromos, MomInicio);$
        \If{$max(DifCiclos) >1$}
            \State \textbf{retornar} $\infty$;
        \EndIf
        \State $PesoPedTQ \gets CalculaPesoTQ(cromos)$;
        \State $QtdPedLamin \gets ContarPedidosLamin(cromos)$;
        \State $Metrica =  \alpha Antec +  \beta Atras + (TL + TE + QtdPedTQ + DifCiclos + QtdPedLamin) $;
    \end{algorithmic}
\end{algorithm}


\end{document}

相关内容