[Tex/LaTex] Remove the colon from line numbering in algpseudocode

algorithmicalgorithmsnumbering

Is there a way to remove the colon (:) from the line numbering in algorithms (using the algpseudocode package)?

\documentclass{article}
\usepackage{algpseudocode}

\begin{document}    
\begin{algorithmic}[1]
\Function{Euclid}{a,b}
\State r\gets a\bmod b
\If{r\not=0}
\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
\EndIf 
\State \Return b \Comment{The g.c.d. is b} 
\EndFunction
\end{algorithmic}
\end{document}

For example, instead of getting
enter image description here

we would get

enter image description here

Best Answer

You have to redefine \alglinenumber:

\documentclass{article}
\usepackage{algpseudocode}

\algrenewcommand\alglinenumber[1]{\footnotesize #1}

\begin{document}
\begin{algorithmic}[1]
\Function{Euclid}{$a,b$}
\State $r\gets a\bmod b$
\If{$r\not=0$}
\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
\EndIf
\State \Return $b$ \Comment{The g.c.d. is $b$}
\EndFunction
\end{algorithmic}
\end{document}

enter image description here

Related Question