Graphics, Figures & Tableswrapfig | Wrapped Table causes Error

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
PJensen
Posts: 5
Joined: Wed Apr 25, 2012 2:16 pm

wrapfig | Wrapped Table causes Error

Post by PJensen »

Hi,

I have a problem with wrapping text around a table. I use the wrapfig package but get the error:

Code: Select all

LaTex Error: Not in outer par mode...

l.19 \begin{table}[h] ?
Part of the preamble is:

Code: Select all

\documentclass[a4paper,11pt,danish,twoside,openright]{article}
\usepackage{color}
\usepackage{graphics}
\usepackage{wrapfig}
\usepackage{threeparttable}
\usepackage{array,booktabs}
\usepackage[danish]{varioref}				          	
\usepackage{siunitx,booktabs}						
\usepackage[tableposition=top,hang,small,bf]{caption}
Table...

Code: Select all

\begin{wraptable}{l}{0.5\textwidth}
\caption{some text}
\label{tab:test}
\begin{table}[h]
\centering
\begin{threeparttable}
\begin{tabular}{l c c}
\toprule
\toprule
Temperature & Open & Closed \\ 
\midrule
$6\,^{ \circ}$C & 540 sec. & 8100 sec.\\
$25\,^{ \circ}$C & 180 sec. & 2700 sec.\\
$32\,^{ \circ}$C& 90 sec. & 1350 sec. \\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}
\end{wraptable}
Anyone got an idea for solving this problem?


Regards,
PJensen
Last edited by localghost on Tue May 08, 2012 6:02 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

wrapfig | Wrapped Table causes Error

Post by localghost »

A proper minimal example will certainly help to get closer to a solution. Due to missing information it is almost impossible to help at this moment.


Best regards and welcome to the board
Thorsten
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

wrapfig | Wrapped Table causes Error

Post by Stefan Kottwitz »

Hi PJensen,

welcome to the board!

I agree with Thorsten, that a complete code example makes it usually easier to give an answer. Once we can test, we can fix the problem. Otherwise a solution can hardly be guaranteed.

In this case, you've got luck ;-) the cause is can be seen: you cannot use a table environment within the wraptable environment. Just use only wraptable. You probably will see that it works after you removed \begin{table}[h] and \end{table}.

wraptable already supports \caption.

Stefan
LaTeX.org admin
PJensen
Posts: 5
Joined: Wed Apr 25, 2012 2:16 pm

wrapfig | Wrapped Table causes Error

Post by PJensen »

Sorry for the bad post - will not happen again (I hope :) ) Even though you didn't come up with a solution you make me think, and I solved it.. So thank you!

The problem was that I had both:
\begin{table}
\begin{tabular}

and with \begin{wraptable} the \begin{table} should not be included.

Regards,
PJensen

## and as I wrote this I got exact that reply - thank you
Post Reply