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}