Change name in pseudocode

I am writing my code in pseudocode package and I would need to change the name "Algorithm" to "Algoritmus".

Is there any possibility how to do this in this package? I have found it just for package algorithm, but I have everything written and I don't want to change my whole work to different environment.

Thank you for any help.

• – Werner
Apr 24, 2017 at 22:11
• @Werner It doesn't seem to be a duplicate as the issues are particular to this package Apr 24, 2017 at 22:19
• @DavidCarlisle: True. Read "possible duplicates" as "related". :-|
– Werner
Apr 24, 2017 at 22:20
• @AboAmmar that says how to redefine \ALG@name which won't help here, Apr 24, 2017 at 22:21

packages should use \xxxname commands for fixed strings so that they can be easily changed as you request but unfortunately this uses the fixed text in the middle of a large command setup.

However you can patch the definition as follows

\documentclass{article}

\usepackage{pseudocode}
\usepackage{etoolbox}
\begin{document}

\begin{pseudocode}{a}{b}

\end{pseudocode}

\end{document}

• \xpatchcmd{\pseudocode}{Algorithm}{Algoritmus}{}{} is easier, with \xpatch. Nice package, isn't it? Apr 24, 2017 at 22:47

David's patch is good, but it can be largely improved, for instance making the name language aware and adding easy support for changing the formatting of the header.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,czech]{babel}

\usepackage{pseudocode}
\usepackage{xpatch}

% fix the bad code in pseudocode.sty
\providecommand{\algorithmname}{Algorithm}
% end of fix

\begin{document}

\begin{pseudocode}{CelsiusToFahrenheit}{c}
f \GETS {9c/5} + 32\\
\RETURN{f}
\end{pseudocode}

\selectlanguage{english}

\begin{pseudocode}{CelsiusToFahrenheit}{c}
f \GETS {9c/5} + 32\\
\RETURN{f}
\end{pseudocode}

\end{document}


I added \renewcommand{\algorithmheadformat}{\scshape} just by way of example.