Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to change the default font size of the algorithm in algpseudocode environment to small. This is because my algorithm is lengthy and i have page limitations. Please help

share|improve this question

1 Answer 1

Package algorithmicx provides hooks for use before and after the pseudocode: \ALG@beginalgorithmic and \ALG@endalgorithmic. You can redefine them to suit your needs:

\documentclass{article}

\usepackage{algpseudocode}

\makeatletter
\renewcommand{\ALG@beginalgorithmic}{\small}
\makeatother

\begin{document}

\begin{algorithmic}[1]
  \State $x \gets 42$
\end{algorithmic}

\end{document}

Note that other algorithmicx layouts may redefine the commands. Also note that this doesn't affect line number size, which is controlled by \alglinenumber.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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