[Tex/LaTex] Problems with landscape mode and Title on the same page

landscape

For an appendix I am trying to create rotated tables and I am using the landscape mode for this. Only one problem is holding me back; As soon as I am trying to add the title of the appendix to the tables I created, either the title is rotated ( see the following code):

\begin{landscape}
\section{blabla}
    \begin{table}
     blablabla
    \end{table}
\end{landscape}

Or when I write the section name outside the landscape mode, The title starts on an empty page and the tables start on the next page (which is ugly).(see following code):

\section{blabla}
\begin{landscape}
     \begin{table}
     blablabla
     \end{table}
\end{landscape}

Does anyone know how to solve this?

Best Answer

The hvfloat package is highly flexible and offers you the possibility to have several rotated tables in one page; in the following example I deactivated flotation for all tables, using the nonFloat=true option; notice also the capWidth=w option so the caption width will be the same as the table width:

\documentclass{article}
\usepackage[a6paper]{geometry}% just for the example
\usepackage{booktabs}
\usepackage{hvfloat}

\begin{document}

\section{Test Section with Several Rotated Objects}

\hvFloat[%
nonFloat=true,%
capWidth=w,%
capPos=t,%
rotAngle=90,%
objectPos=c%
]{table}{%
    \begin{tabular}{ll}
    \toprule
    column1a & column2a \\
    column2b & column2b \\
    column1c & column2c \\
    column1d & column2d \\
    \bottomrule
    \end{tabular}%
}{%
A test rotated table}{tab:test1}

\vfill

\hvFloat[%
nonFloat=true,%
capWidth=w,%
capPos=t,%
rotAngle=90,%
objectPos=c%
]{table}{%
    \begin{tabular}{ll}
    \toprule
    column1a & column2a \\
    column2b & column2b \\
    column1c & column2c \\
    column1d & column2d \\
    \bottomrule
    \end{tabular}%
}{Another test rotated table}{tab:test2}

\end{document}

enter image description here

Related Question