I am trying to place a figure and an algorithm side-by-side using minipage. Hee is the code for the algorithm part. However, I am getting an error LaTeX Error: Not in outer par mode.
on the line \KwData
. If I delete it, I am getting the error on the next line \Input
\documentclass{article}
\usepackage[linesnumbered,ruled,vlined]{algorithm2e}
\begin{minipage}{0.6\textwidth}
\centering
\captionof{algocf}{CAPTION}
\label{alg:alg2}
\begin{algorithm}
\KwData{$ . . .$}
\Input{$ . . . $}
\eIf{$ condition $}{
$ . . . . $
}{
$ . . . . $
}
\end{algorithm}
\end{minipage}%
Best Answer
Use the
H
specifier as mentioned in the manual.