Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to place a figure and a table inside the same wide float so that they are positioned together within a two-column document. However, they also need separate captions (i.e. a figure caption and a table caption).

I tried to wrap the table (\begin{tabular}...\end{tabular}) and the figure (\begin{figure}...\end{figure}) inside a figure*, but then I get a compilation error:

Float(s) lost.

And in the minimal example below, I get

LaTeX Error: Not in outer mode

as error.

\documentclass[twocolumn]{article}

\usepackage{lipsum}

\begin{document}
\begin{figure*}[t]
  \centering
  \begin{minipage}{\textwidth}
    \begin{figure}
      stuff
      \caption{abc}
    \end{figure}
    \begin{tabular}
      \begin{table}{c}
        more stuff
      \end{table}
      \caption{abc}
    \end{tabular}
  \end{minipage}
\end{figure*}
\lipsum
\lipsum
\end{document}

Anyone know how to solve this?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You can't put a figure inside a figure (or inside a minipage even), which is why you are getting floats lost. Just use a figure* on the outside and then use the caption or capt-of packages to allow you to go \captionof{table}{.....} for the table caption. Don't use table or figure environments within the float, just use \includegraphics tabular etc directly.

Note as it's a figure* latex will only ensure that it keeps the right order for the figure. the table may float out of sequence (similarly to using longtable or a [H] float from the float package). If that does happen you may need to help the ordering by moving tables in the source or adding \clearpage.

share|improve this answer
    
Perfect! capt-of was just what I needed. –  gablin Mar 1 '12 at 11:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.