I want to put an algorithm inside a box. Here is the code
\fbox{\parbox{0.8\linewidth}{
\begin{algorithm}
\caption{My algorithm}
\begin{algorithmic}[1]
\scriptsize
...
\end{algorithmic}
\end{algorithm}
}}
I am getting this error:
Not in outer par mode
following other error at the line where the two ending curly brackets are. The problem is solved when i remove the algorithm
environment and i have only the algorithmic
. But i want to have algorithm environment to put the caption.
algorithm2e
, or thelistings
package. With the oldalgorithm
stuff this is not easily possible.algorithm
is a float environment. If you put the box only inalgorithmic
it should work.\begin{algorithm}\fbox{\begin{minipage}[b]{\textwidth} \begin{algorithmic} ... \end{agorithmic} \end{minipage}} end{algorithm}
\fbox
and\parbox
instead ofalgorithm2e
box features ? see more primitive TeX boxes