# How to insert algorithm inside multicols environment [duplicate]

Possible Duplicate:
Placing figures inside a two-column document

Here is my MWE:

\documentclass{article}

\usepackage{multicol}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{lipsum}

\begin{document}
\title{How to insert algorithm inside multicols environment}
\author{pythonee}
\date{}

\maketitle

\begin{abstract}
\lipsum[1-2]
\end{abstract}

\begin{multicols*}{2}
\begin{algorithm}
\caption{Euclid’s algorithm}\label{euclid}
\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{algorithm}

\end{multicols*}

\end{document}

It output the warning message when I compile this:

Package multicol Warning: Floats and marginpars not allowed inside `multicols'
environment!.

And the pseudocode is missing.

Can you tell me how to insert single column float algorithm environment. I don't want algorithm* style.

-

## marked as duplicate by Werner, Marco Daniel, egreg, cmhughes, percusseJul 17 '12 at 13:45

Are you okay with a non-floating algorithm? –  Werner Jul 1 '12 at 2:18
@Werner basically, I really want floating algorithm. As I have tried to add [H] parameter into algorithm. but there leave much blank space –  pythonee Jul 1 '12 at 2:31
This problem can be generalized in terms of placing a float inside the multicols environment. For that, Frank's answer in Placing figures inside a two-column document should provide a solution, however minimal, and one could consider this question a duplicate. –  Werner Jul 1 '12 at 2:58