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.

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

Is it possible to put an algorithm inside a \begin{itemize} as one of the \items?

share|improve this question

Yes, just don't use a floating environment.


\Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b} 
\State $r\gets a\bmod b$ 
\While{$r\not=0$}\Comment{We have the answer if r is 0} 
\State $a\gets b$ 
\State $b\gets r$ 
\State $r\gets a\bmod b$ 
\State \textbf{return} $b$\Comment{The gcd is b} 
share|improve this answer

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.