4

I am having problems with a table in landscape orientation. This table occupies an entire page and it is preceded by a chapter title. Even though there is nothing else on the page, the table is placed on a new page. I already tried to reduce the number of rows on the table, but even if it has only one row, it is still placed on a new page. Here is what I have:

\begin{landscape}

\chapter{Title}

\begin{table}[h]
\centering
\begin{tabular}{|c|l|l|}
 ....
\end{tabular}
\end{table}

\end{landscape}

I also tried to have a sidewaystable, but I keep having the same problem. Even without the landscape environment, the title stays on one page and the table is in the next one. So I have one page with a title and nothing else and another one with a table.

Can anyone help me understand what the problem is? Thank you.

mfra
  • 43
  • 2
    Welcome to the site! Please provide a complete compilable latex document, starting with \documentclass and ending with \end{document}. Then I can reproduce your problem on my computer and start thinking about a solution. – John Wickerson May 28 '14 at 21:44
  • Are you using a \caption for your table? – Gonzalo Medina May 29 '14 at 00:22

3 Answers3

2

You haven't provided a real example so it your question is rather unclear but something like

\chapter{Title}

\rotatebox{90){%
\begin{tabular}{ccc}
...
\end{tabular}%
}

will put a rotated table after the chapter heading, on the same page if there is room.

David Carlisle
  • 757,742
2

You can use the hvfloat package; in this way, you can control at will the rotation of the table and its eventual caption; the nonFloat=true option guarantees that no flotation will happen:

\documentclass{book}
\usepackage{hvfloat}
\usepackage{booktabs}

\begin{document}

\chapter{Test chapter}

\hvFloat[%
nonFloat=true,
objectAngle=90,%
capPos=r,%
capAngle=90,
capWidth=0.5]{table}{%
\begin{tabular}{cccc}
  \toprule
  text & text & text & text \\
  text & text & text & text \\
  text & text & text & text \\
  text & text & text & text \\
  text & text & text & text \\
  \bottomrule
\end{tabular}%
}{this is a caption for the rotated table in the example}{tab:test}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
0

Best is to put the table in the second page using afterpage package.

\documentclass{book}
\usepackage{afterpage}
\usepackage{pdflscape}
\usepackage{kantlipsum}
\begin{document}
\chapter{Title}
\afterpage{%
\begin{landscape}
\begin{table}[h]
\centering
\begin{tabular}{|c|l|l|}
 ....
\end{tabular}
\end{table}
\end{landscape}
\clearpage   %% <------- important
}
\kant[1-5]


\end{document}

enter image description here

Note that here, the first page is filled with text and when the first page ends and second starts, the table is typeset.