I have the following algorithm. Could any one please let me know how I can put it in a minipage?
\begin{algorithm}\small
{Start}\;
\eIf{A is bigger than B}{
\eIf{if A is bigger than C}{
A;
}{
C;
}
}{
\eIf{B is bigger than C}{
B; }{
C;
}
}
\caption{A B C comparison}
\end{algorithm}
Best Answer
Your issue is
algorithm
is a float environment by default, and you can't have floats inside aminipage
. However, you can specify the[H]
option to suppress floating and have it work as you intend:In the future please include a MWE showing your
\documentclass
and\usepackage
commands, helps people help you! I've never usedalgorythm2e
so it took me a bit to find the right package.