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.
-
1possible duplicate of How to localize label using algorithm and algorithmic packageslockstep– lockstep2014-03-03 16:10:52 +00:00Commented Mar 3, 2014 at 16:10
-
thank you! Now it displays "Algorithmus 1: XYZ". Now I only need the number to be removed, if it is possible.dh87– dh872014-03-03 16:17:33 +00:00Commented Mar 3, 2014 at 16:17
-
Sorry for missing the part about numbering.lockstep– lockstep2014-03-03 16:22:53 +00:00Commented Mar 3, 2014 at 16:22
Add a comment
|
1 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}