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.

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.

share|improve this question
add comment

2 Answers

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

share|improve this answer
add comment

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.

share|improve this answer
    
I made the adjustment as suggested, but the result is the same. –  Chernoff Apr 25 '12 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. –  Ian Thompson Apr 25 '12 at 20:57
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.