4

I am sorry, there seems to be a similar question already, but I didn't get the answer. I have a chapter heading and then two wide but short tables with captions, which I would like to rotate. But after rotating they should be on the same page as the caption.

\chapter{Some caption}
\begin{table}
\begin{tabular}
[...some table...]
\end{tabular}
\caption{caption1}
\end{table}

\begin{table}
\begin{tabular}
[...some other table...]
\end{tabular}
\caption{caption2}
\end{table}

If I use sidewaystable, it puts the tables on a seperate page. I can also use:

\begin{table}
\begin{rotate}
\begin{tabular}
[...some table...]
\end{tabular}
\begin{tabular}
[...some other table...]
\end{tabular}
\end{rotate}
\cation{combined caption 1 and 2}
\end{table}

but that will place the two tables alongside and not after each other. So if _ is the non rotated table and | the rotated table, I can get

caption
_
_

or

caption
|
|

but what i want is

caption
| |

Thanks for any help!

4

Using the adjustbox package:

\documentclass{book}
\usepackage{adjustbox}

\begin{document}

\begin{table}
\centering
\caption{combined caption for both rotated tables}
\begin{adjustbox}{angle=90}
\begin{tabular}{l}
\hline
text \\
text \\
text \\
\hline
\end{tabular}
\end{adjustbox}\quad
\begin{adjustbox}{angle=90}
\begin{tabular}{l}
\hline
text \\
text \\
text \\
\hline
\end{tabular}
\end{adjustbox}
\end{table}

\end{document}

enter image description here

Since you want your tables to appear at a specific location, perhaps you should consider not using a float object; you can use a minipage instead and you can provide a caption using \captionof from the caption or the capt-of packages:

\documentclass{book}
\usepackage{adjustbox}
\usepackage{caption}

\begin{document}

\noindent\begin{minipage}{\linewidth}
\centering
\captionof{figure}{combined caption for both rotated tables}
\begin{adjustbox}{angle=90}
\begin{tabular}{l}
\hline
text \\
text \\
text \\
\hline
\end{tabular}
\end{adjustbox}\quad
\begin{adjustbox}{angle=90}
\begin{tabular}{l}
\hline
text \\
text \\
text \\
\hline
\end{tabular}
\end{adjustbox}
\end{minipage}

\end{document}

Are you sure there isn't a better alternative than forcing the reader to rotate his/her head to read the tables?

  • same for your answer!: Wonderful! Thank you very much! And yes, I believe it is the best alternative. Its just a unit conversion table... – user1638145 Apr 12 '14 at 14:06
  • @user1638145 I've updated my answer providing an option that might be of interest for you. – Gonzalo Medina Apr 12 '14 at 14:13
3

Will this do?

\documentclass{article}
\usepackage{graphicx}
\begin{document}
  \begin{table}[htbp]
  \centering
  \caption{combined caption 1 and 2}
\rotatebox[origin=c]{90}{%
\begin{tabular}{ccc}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\end{tabular}%
}%
\hfil   %% just to demarkate
\rotatebox[origin=c]{90}{%
\begin{tabular}{ccc}
7 & 8  \\
4 & 5  \\
1 & 2  \\
\end{tabular}%
}%
\end{table}
\end{document}

enter image description here

  • Wonderful! simple and fast and just what I wanted! – user1638145 Apr 12 '14 at 14:05

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.