[Tex/LaTex] algorithmic package, get rid of algorithms numbers

algorithmsnumbering

My question is about algorithmic package.
I have an algorithm which I called A1.

\begin{algorithm}
\caption{\bf A1:}
\label{algorithm-A1}
...

I have something like this:

Algorithm 1 A1

How can I make that I will get

Algorithm A1

And another question how I can labelling so that when I use \ref{algorithm-A1}, then link will appear as A1 in a text.

Best Answer

The following works for me, note in particular the line

\renewcommand{\thealgorithm}{A\arabic{algorithm}}

which @Werner mentioned in his comment. Note also that this code is an example of a MWE

enter image description here

\documentclass{article}

\usepackage{algorithm}
\usepackage{algpseudocode}
\renewcommand{\thealgorithm}{A\arabic{algorithm}}

\begin{document}

\begin{algorithm}
    \caption{Euclid’s algorithm}
    \label{alg:euclid}
    \begin{algorithmic}[1]
        \Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b}
        \State $r\gets a\bmod b$
        \While{$r\not=0$}\Comment{We have the answer if r is 0}
        \State $a\gets b$
        \State $b\gets r$
        \State $r\gets a\bmod b$
        \EndWhile\label{euclidendwhile}
        \State \textbf{return} $b$\Comment{The gcd is b}
        \EndProcedure
    \end{algorithmic}
\end{algorithm}

Test reference: \ref{alg:euclid}

\end{document}