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've been trying to use the wrapfigure and wraptable from the wrapfig package, but to no avail.

This works for text.

\begin{wrapfigure}{l}{40mm}
    \begin{center}          
        Some random text
    \end{center}
\end{wrapfigure}

This should be to the left of the table. \blindtext

But once I add a table (see code below), it fails.

\begin{wrapfigure}{l}{40mm}
    \begin{center}
        \begin{table}
            \begin{tabular}{l | c}
            A & Cell 1 \\ \hline
            B & Cell 2 \\ \hline
            \end{tabular}
        \end{table} \\
        Some random text
    \end{center}
\end{wrapfigure}

This should be to the left of the table. \blindtext

What am I doing wrong?

Thanks.

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

The table environment is for normal floating tables. You do not need to put a tabular inside a table environment. You should use the wraptable environment instead.

\begin{wraptable}{l}{40mm}
    \begin{tabular}{l | c}
      A & Cell 1 \\ \hline
      B & Cell 2 \\ \hline
    \end{tabular}
   Some random text
\end{wraptable}

This should be to the left of the table. \blindtext
share|improve this answer
    
Thanks. Final question... can you recommend a document/site that would contain this and other similar information? –  haroldcampbell Jan 11 '12 at 23:04
    
@haroldcampbell It always helps to read the package documentation: doing texdoc wrapfig from the Command Line/Terminal would reveal the existence of the wraptable environment. –  Joseph Wright Jan 12 '12 at 6:50
    
Thanks. Didn't know about that command. –  haroldcampbell Jan 12 '12 at 14:30
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.