2

With the packages wrapfig and rotating and calls to wraptable, sideways and tabular, I get a document where the table is placed at the end of the document. For instance, in a two page document defined by \pagebreak, my table gets placed on the second page, or at the end of the document, and not where I want it, on the first page where it is declared. Anyone know why this happens or have a work around?

\documentclass[12pt,letterpaper]{article}
\usepackage[american]{babel}
\usepackage{rotating}
\usepackage{wrapfig}

\begin{document}

\section{Test page 1}

\begin{wraptable}{r}{.5\textwidth}
\begin{sideways}
\begin{tabular}{l}
1 \\
2 \\
3 \\
4
\end{tabular}
\end{sideways}
\end{wraptable}

\pagebreak

\section{Test page 2}

\end{document}

Basically, I want to rotate a (sizable) table on a page that also has horizontal text.

2 Answers 2

2

wraptable is meant to be used along with text such that it wraps along. You just add text before and after wraptable, then things are set right.

\documentclass[12pt,letterpaper]{article}
\usepackage[american]{babel}
\usepackage{rotating}
\usepackage{wrapfig,lipsum}

\begin{document}

\section{Test page 1}
\lipsum[1]
\begin{wraptable}{r}{.5\textwidth}
\caption{A wrapped table will not float if there is enough text surrounding it.}\label{wrap-tab:1}
\begin{sideways}
\begin{tabular}{l}\\
1 \\
2 \\
3 \\
4
\end{tabular}
\end{sideways}
\end{wraptable}
\lipsum[2] %%% This provides text.
\pagebreak

\section{Test page 2}

\end{document}

enter image description here

0

Normally, using a lower case letter to specify horizontal placement will create a stationary wraptable or wrapfig, that is

\begin{wraptable}{r}{.5\textwidth}

does not float, whereas

\begin{wraptable}{R}{.5\textwidth}

does. However, stationary wrapfigs and wraptables can be forced to float under some circumstances. Sadly, the package documentation isn't very helpful here, but I have noticed that wraptables and wrapfigs can be very sensitive to what's around them. For example, inserting a short piece of text immediately before the wraptable in your code causes the table to appear on page 1.

2
  • I made the adjustment as suggested, but the result is the same.
    – Chernoff
    Commented Apr 25, 2012 at 20:13
  • Actually my suggestion was wrong anyway! I have edited my answer, and I now get the wraptable on page 1, but it's hard to say whether it will help in your actual document. Commented Apr 25, 2012 at 20:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .