[Tex/LaTex] change “Algorithm 1:” to “Algorithmus:” in algorithm package

algorithmsnaming

I am using the algorithm package and I need my algorithm to be labeled as "Algorithmus: XYZ" instead of "Algorithm 1: XYZ" where XYZ is my caption for the algorithm.

Best Answer

I think loading the package caption is the appropriate way.

\usepackage{caption}
\DeclareCaptionLabelFormat{alglabel}{\bfseries\csname ALG@name\endcsname:}
\captionsetup[algorithm]{labelformat=alglabel}

\documentclass{article}

\usepackage[english]{babel}

\usepackage{algorithmic}
\usepackage{algorithm}
\makeatletter
\addto\captionsenglish{\renewcommand{\ALG@name}{Algorithmus}}
\makeatother
\usepackage{caption}
\DeclareCaptionLabelFormat{alglabel}{\bfseries\csname ALG@name\endcsname:}
\captionsetup[algorithm]{labelformat=alglabel}
\begin{document}

\begin{algorithm}
\caption{An algorithm}
\begin{algorithmic}
\STATE Some text.
\end{algorithmic}
\end{algorithm}

\end{document}