2

It may be a strange question but I want to change the word "Algorithm" to "Operation" in an algorithm list. I am using the package algorithm2e.

\usepackage[ruled, vlined]{algorithm2e}

\begin{algorithm} [tb] \DontPrintSemicolon \caption{title.}
\label{label}

some content 1\ some content 2\

\end{algorithm}

It will generate the algorithm like:

-------
Algorithm 1: title
-------
some content 1
some content 2
-------

What I want to do is to change the word "Algorithm" to another word... Is it possible?

In fact, I have some pseudocode to show in my paper, but the pseudocode is short. So it is more like maybe an operation rather than a complete algorithm. Therefore, if the answer is "No" to my question, are there any other suggestions for my case?

Joxixi
  • 123
  • Just a quote from the documentation page 17

    \SetAlgorithmName{algorithmname}{algorithmautorefname}{list of algorithms name}

    which redefines name of the algorithms and the sentence list of algorithms. Example: \SetAlgorithmName{Protocol}{List of protocols} if you prefer protocol than algorithm. Second argument is the name that \autoref, from hyperref package, will use.

    – Celdor Aug 09 '22 at 21:19

2 Answers2

4

You can use

\SetAlgorithmName{Operation}{List of Operations}{operation}

in the document preamble.

\documentclass{article}
\usepackage[ruled, vlined]{algorithm2e}

\SetAlgorithmName{Operation}{List of Operations}{operation}

\begin{document}

\begin{algorithm} [tb] \DontPrintSemicolon \caption{title.}
\label{label}

some content 1\ some content 2\

\end{algorithm}

\end{document}

enter image description here

egreg
  • 1,121,712
3

As you use algorithm2e:

\documentclass{article}

\usepackage[ruled, vlined]{algorithm2e}

\begin{document}

\renewcommand{\algorithmcfname}{Operation} \begin{algorithm} [tb] \DontPrintSemicolon \caption{title.}
\label{label}

some content 1\ some content 2\

\end{algorithm}
\end{document}

enter image description here