TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

\small or other tag seems can not change the font size of the line number.

The package I use is \usepackage{algorithmic}.

share|improve this question
Hi, welcome to tex.SX. So that people can better understand your question, it's helpful to add a minimal example that illustrates your problem. What package are you loading to display the algorithms? – Alan Munn Feb 26 '11 at 11:13
I agree with Alan, there are several different packages that can be used to describe an algorithm, without knowing which one you are using, there really isn't much anybody can do to help you. – Jan Hlavacek Feb 26 '11 at 14:29
@ Alan I use the \usepackage{algorithmic} – Fan Zhang Feb 27 '11 at 5:51
up vote 2 down vote accepted

Use \algsetup{linenosize=\small}. See p. 12 of the documentation of the algorithms bundle for details.




\IF{some condition is true}
\STATE do some processing
\STATE do the default actions

share|improve this answer
it only changes the size of the number of line but not the global font, how can i change the font size??? – flow Jun 29 '11 at 15:14
@gpu_drug: \usepackage{etoolbox}\AtBeginEnvironment{algorithmic}{\small} – lockstep Jun 29 '11 at 15:25
This did't work for me. The solution from tex.stackexchange.com/questions/16059/… works. – Alejandro Jul 13 '11 at 22:53

Your Answer


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.