1

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

2

Yes, just don't use a floating environment.

\documentclass{article}
\usepackage{algpseudocode}
\begin{document}

\begin{itemize}
\item
\begin{algorithmic}[1] 
\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$ 
\EndWhile\label{euclidendwhile} 
\State \textbf{return} $b$\Comment{The gcd is b} 
\EndProcedure 
\end{algorithmic} 
\end{itemize}
\end{document}
| improve this answer | |

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.