# How can I create a multicol “figure”?

I have the following, somewhat minimal, example:

 \documentclass{article}
\usepackage{multicol}

\begin{document}
\begin{multicols}{2}

\begin{minipage}{\textwidth}
\begin{framed}

The function is
\begin{equation*}
F(1)
\end{equation*}

The negation is
\begin{equation*}
N(1)
\end{equation*}

\begin{center}
\bf{\underline{Figure 1.}} Function
\end{center}
\end{framed}
\end{minipage}

\end{multicols}
\end{document}


It creates a "figure" with a box around it and a caption.

There are some problems. First, I'm using the multicol package, so I'd like to do this succesfully in one column. That means changing the \textwidth value, or using something other than minipage. I thought that I might be able to use a float to do this, but I don't even know how to get floats to display text. It may again have something to do with multicol.

The main problem I have is that I can use the "framed" portion of the text to display a figure, but LaTeX tends to break the frame into two pieces, and devote an entire page to one of the pieces, which is far more space than it needs. That is how LaTeX displays this without using minipage. So I'm really wondering how I can ensure that this framed portion is not broken into pieces.

Really as a separate question, I'm wondering how I can use floats to display this also. But again, I'd really like to know how to do it without floats, first.

-

I'm not sure that I understand your question. I think you just want a full page figure. Something like this.

\documentclass{article}
\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{framed}
\usepackage{multicol}
\begin{document}
\begin{multicols}{2}
\begin{figure*}
\begin{framed}
The function is
\begin{equation*}
F(1)
\end{equation*}

The negation is
\begin{equation*}
N(1)
\end{equation*}
\caption{Function}
\end{framed}
\end{figure*}
\lipsum
\end{multicols}
\end{document}

-
@TH I wasn't sure if I understood the question also:) –  Yiannis Lazarides Jan 11 '11 at 1:28
Sorry I wasn't more descriptive. I have a small figure, and I'm using two columns. I'm trying to display this figure in the top of the left column. Unfortunately, LaTeX breaks apart this figure and uses an entire page to display just part of it. What I want is for this figure to be shown in its entirety on the same page as the rest of the text, alot like the bottom figure in Yiannis Lazarides's answer. –  Matt Groff Jan 11 '11 at 3:07
@Matt: Ah. It seems that floats are not allowed inside multicols. If you can, I suggest using the twocolumn option to the standard document classes. Single column floats work just fine in there. –  TH. Jan 11 '11 at 6:41
Thanks for the suggestion. Now I'm wondering how I can get the Title and some floats to span both columns. –  Matt Groff Jan 11 '11 at 11:04
@Matt: I don't know what you mean by Title here, but \maketitle spans the page and the figure* environment places full width figures. –  TH. Jan 11 '11 at 11:26

Using a minipage, you ensure that any figure you produce is not breakable.

This basically means - you will have to hand design your pages. Minimal code is shown below:

\documentclass{article}
\usepackage{multicol,framed,amsmath,lipsum}

\begin{document}

\lipsum[1]
\begin{multicols}{2}
\noindent\begin{minipage}{\textwidth}
\begin{framed}
The function is
\begin{equation*}
F(1)
\end{equation*}
The negation is
\begin{equation*}
N(1)
\end{equation*}
\begin{center}
\bf{\underline{Figure 1.}} Function
\end{center}
\end{framed}
\end{minipage}
\end{multicols}
\begin{multicols}{2}
\lipsum[3]
\noindent\begin{minipage}{0.5\textwidth}
\begin{framed}
The function is
\begin{equation*}
F(1)
\end{equation*}
The negation is
\begin{equation*}
N(1)
\end{equation*}
\begin{center}
\bf{\underline{Figure 1.}} Function
\end{center}
\end{framed}
\end{minipage}
\end{multicols}
\lipsum[1]
\end{document}


You need to play with the text and the figures a bit. If you want the figure to be one column on top of first column do:

\begin{multicols}{2}
\noindent\begin{minipage}{0.5\textwidth}
\begin{framed}
The function is
\begin{equation*}
F(1)
\end{equation*}
The negation is
\begin{equation*}
N(1)
\end{equation*}
\begin{center}
\bf{\underline{Figure 1.}} Function
\end{center}
\end{framed}
\end{minipage}
\lipsum
\end{multicols}

-
@Matt Groff See edit! –  Yiannis Lazarides Jan 11 '11 at 3:17
\documentclass{article}
\usepackage{multicol,caption,amsmath,framed}

\begin{document}
\begin{multicols}{2}
text above the ,,float

\begin{framed}
\begin{minipage}{\linewidth}
The function is
\begin{equation*}
F(1)
\end{equation*}

The negation is
\begin{equation*}
N(1)
\end{equation*}

\captionof{figure}{Function}
\end{minipage}
\end{framed}

text after the ,,float

\end{multicols}
\end{document}

-