Take the 2-minute tour ×

I'm using and enjoying the algorithmicx package, but would like to adjust the size of its indentations.

In the algorithms package, I could do this with \algsetup{indent=1em}, but that doesn't seem to work here.

Any thoughts?

share|improve this question

1 Answer 1

up vote 13 down vote accepted

You can renew the internal command \algorithmicindent:


Change the 2.0em to whatever you wish.

Here is a MWE extracted from the documentation and adapted:

\algrenewcommand{\algorithmiccomment}[1]{\hskip3em$\rightarrow$ #1}
\State $x\gets x+1$\Comment{Here is the new comment}
\caption{\euk's algorithm}\label{euclid}
\Procedure{\euk}{$a,b$}\Comment{The g.c.d. of a and b}
   \State $r\gets a\bmod b$
      \State $a\gets b$
      \State $b\gets r$
      \State $r\gets a\bmod b$
   \State \Return $b$\Comment{The gcd is b}
share|improve this answer
Awesome, thank you! –  Richard Mar 12 '12 at 20:11

Your Answer


