算法环境中的重命名程序

算法环境中的重命名程序

algorithm我在论文中多次使用以下内容:

\begin{algorithm}[!t]
  \caption{Title}
  \begin{algorithmic}[1]

    \Procedure{Graph}{$ \alpha, \beta $}    
    \State ...
    \EndProcedure
  \end{algorithmic}
\end{algorithm}

我怎样才能更改为仅procedure显示pseudocode单身的 algorithm环境而不影响整篇论文?

谢谢

答案1

\algorithmicprocedure在所需环境范围内改变的定义algorithm

\documentclass{article}
\usepackage{algorithm}
\usepackage{algpseudocode}

\begin{document}

\begin{algorithm}[!t]
\caption{Title}

\algrenewcommand\algorithmicprocedure{\textbf{pseudocode}}

\begin{algorithmic}[1]

\Procedure{Graph}{$ \alpha, \beta $}    
  \State ...
\EndProcedure

\end{algorithmic}
\end{algorithm}

\begin{algorithm}[!t]
\caption{Title}

\begin{algorithmic}[1]

\Procedure{Graph}{$ \alpha, \beta $}    
  \State ...
\EndProcedure

\end{algorithmic}
\end{algorithm}

\end{document}

在此处输入图片描述

相关内容