1

I am trying to figure out how to "wrap" portrait-orientated text around a table that is rotated to landscape.

With a portrait-orientated table, this can be easily achieved using the -wrapfig- package and the wraptable environment, however, I cannot work out how to do this when the table needs to be ROTATED 90degrees (i.e., landscaped).

MWE

\documentclass[12pt]{report}

\usepackage{rotating}
\usepackage{lipsum}
\usepackage{booktabs}

\begin{document}

\lipsum[1]

\begin{sidewaystable}[h]
\footnotesize
\centering
\caption[]{\label{tab:summary}\centerline{\textbf{Summary Statistics---blah 
blah}} \\ \footnotesize \lipsum[1]}
\begin{tabular}{lccccccccc}
\toprule
\multicolumn{10}{c}{Summary Statistics (stuff v stuff)} \\
\midrule
(1) & (2) & (3) & (4) & (5) & (6) & (7) & (8) & (9) & (10) \\
\\
& \multicolumn{4}{c}{Stuff} & \multicolumn{4}{c}{Stuff} & Stuff \\
\\
stuff & stuff & stuff & stuff & stuff & stuff & stuff & stuff & stuff & 
stuff \\
\\
\midrule
\\    
 X  &    123  & 123  & 123  & 123  & 123   & 123  & 123   & 123  & 123 \\
 X  &    123  & 123  & 123  & 123  & 123   & 123  & 123   & 123  & 123 \\
 X  &    123  & 123  & 123  & 123  & 123   & 123  & 123   & 123  & 123 \\
 X  &    123  & 123  & 123  & 123  & 123   & 123  & 123   & 123  & 123 \\

\bottomrule
\end{tabular}
\end{sidewaystable}
\end{document}

This produces a paragraph on page 1 and then the table on page 2. What I am trying to do is WRAP the text on page 1 AROUND the table on page 2 while preserving the orientation of the text.

  • The environment sidewaystable is always on a new page (as far as I know). – Skillmon Oct 25 '17 at 6:30
  • And welome to TeX.SX! – Skillmon Oct 25 '17 at 7:04
  • True, sidewaystable creates a page-sized float. I was doing this more as an example to illustrate what i wanted :) – kgs Oct 25 '17 at 9:40
1

Utilizing the wrapfig package and the rotating package you could use something like:

\documentclass[12pt]{report}

\usepackage{wrapfig}
\usepackage{rotating}
\usepackage{lipsum}
\usepackage{booktabs}

\begin{document}

\lipsum[1]

\begin{wraptable}{l}{6cm}

\footnotesize
\centering
\caption[]{Summary Statistics---blah blah\label{tab:summary}}
\begin{sideways}
\begin{tabular}{l*9c}
\toprule
\multicolumn{10}{c}{Summary Statistics (stuff v stuff)} \\
\midrule
(1) & (2) & (3) & (4) & (5) & (6) & (7) & (8) & (9) & (10) \\
\\
& \multicolumn{4}{c}{Stuff} & \multicolumn{4}{c}{Stuff} & Stuff \\
\\
stuff & stuff & stuff & stuff & stuff & stuff & stuff & stuff & stuff & 
stuff \\
\\
\midrule
\\    
 X  &    123  & 123  & 123  & 123  & 123   & 123  & 123   & 123  & 123 \\
 X  &    123  & 123  & 123  & 123  & 123   & 123  & 123   & 123  & 123 \\
 X  &    123  & 123  & 123  & 123  & 123   & 123  & 123   & 123  & 123 \\
 X  &    123  & 123  & 123  & 123  & 123   & 123  & 123   & 123  & 123 \\
\bottomrule
\end{tabular}
\end{sideways}
\end{wraptable}
\lipsum[1]
\end{document}

enter image description here

  • Thanks for this suggestion. I was hoping to keep the caption rotated too though :( – kgs Oct 25 '17 at 7:26
  • @kgs \caption inside sideways doesn't work. You could use something like: \multicolumn{10}{c}{\refstepcounter{table}\label{tab:summary}Table~\thetable: Summary Statistics---blah blah}\\[0.5ex] as the first line of the table to rotate the caption, too, though this would not use the \caption command – Skillmon Oct 25 '17 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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