3

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}
3

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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.