[Tex/LaTex] Reduce the line number font size of pseudocode

algorithmicxalgorithmsfontsizepseudocode

I have learned from here on how to reduce the font size in the pseudocode.

The last thing left for me is to reduce the line number font size as well. The following is my MWE, and it seems that \algsetup{linenosize=\tiny} is not working.

\documentclass[a4paper]{article}

\usepackage{algorithmicx}
\usepackage{algorithm} % http://ctan.org/pkg/algorithms
\usepackage[noend]{algpseudocode} % http://ctan.org/pkg/algorithmicx

\begin{document}

\begin{algorithm}
\algsetup{linenosize=\tiny}
\small %\small, \footnotesize, \scriptsize, or \tiny
\caption{a}

\begin{algorithmic}[1]
\Procedure{a}{}
    \While{aa}
        \State aa
    \EndWhile
\EndProcedure
\end{algorithmic}

\label{alg:drs}
\end{algorithm}

\end{document}

Best Answer

You can redefine the \alglinenumber macro:

enter image description here

\documentclass{article}

\usepackage{algorithm} % http://ctan.org/pkg/algorithms
\usepackage[noend]{algpseudocode} % http://ctan.org/pkg/algorithmicx
\algrenewcommand\alglinenumber[1]{\tiny #1:}
\begin{document}

\begin{algorithm}
  \caption{a}\label{alg:drs}
  \begin{algorithmic}[1]
  \Procedure{a}{}
    \While{aa}
      \State aa
    \EndWhile
  \EndProcedure
  \end{algorithmic}
\end{algorithm}

\end{document}