3

I'm using the lscape package to landscape certain pages of the document. These pages basically are a section/subsection heading plus a table that must be landscaped. The problem is that entering landscape mode forces a pagrebreak, so I end up having a first blank page with only the section/subsection heading and a second page with the table. This code should illustrate the problem:

\documentclass[12pt,letterpaper]{article}

\usepackage{lscape}

\begin{document}

\section{Foo}

\subsection{Bar}

\begin{landscape}
  Landscaped content
\end{landscape}

\end{document}

Is there any way to avoid the pagebreak and have the heading and the content in the same page?

Note: I don't want to landscape the section/subsection heading.

  • 1
    if you want to rotate ONLY the table, and it doesn't split across pages, maybe use the rotating package. – Koji Mar 13 '12 at 19:06
  • @koji rotating creates floats, and my guess is that the request was about keeping all the stuff (headings and table) on the same page. if i'm right, \rotatebox (from the graphicx package) is what's needed, together with some fiddling to get things to line up. (the last is why i don't post an answer ... i can't currently test things.) – wasteofspace Feb 5 '13 at 19:50
6

I answered a similar question in a German forum so I take this example.

I recommend the package hvfloat which does exactly what you want.

\documentclass{report}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{hvfloat}
\usepackage{units}
\begin{document}
\section{minimalbeispiel}
\vfill
\begin{center}
   \hvFloat[%
    nonFloat=true,%
    capPos=l,%
    capAngle=90,%
    objectAngle=90,%
]{table}{\tiny%
    \begin{tabular}{llllllll}
    \toprule
    & \multicolumn{4}{c}{Coefficients} & &  \\
    \cmidrule(lr){2-5}
    Clamp. pres. in bar & $b_0$ & $b_1$ & $b_2$ & $b_3$ & $SS_{\text{err}}$ & $R^2$ in \%\\
    \midrule
    15 & $9.63*10^{-1}$ & $-2.16*10^{-3}$ & $3.56*10^{-6}$ & $-3.38*10^{-9}$ & $6.16*10^{-4}$ & 99.88\\
    20 & $9.62*10^{-1}$ & $-2.08*10^{-3}$ & $3.40*10^{-6}$& $-3.27*10^{-9}$ & $8.19*10^{-4}$ & 99.83\\
    25 & $9.64*10^{-1}$ & $-2.08*10^{-3}$ & $3.46*10^{-6}$ & $-3.29*10^{-9}$ & $5.30*10^{-4}$ & 99.89\\
    30 & $9.61*10^{-1}$ & $-1.99*10^{-3}$ & $3.19*10^{-6}$ & $-3.00*10^{-9}$ & $6.99*10^{-4}$ & 99.84\\
    35 & $9.53*10^{-1}$ & $-1.98*10^{-3}$ & $3.09*10^{-6}$ & $-2.92*10^{-9}$ & $6.87*10^{-4}$ & 99.85\\
    40 & $9.53*10^{-1}$ & $-2.04*10^{-3}$ & $3.33*10^{-6}$ & $-3.22*10^{-9}$ & $5.84*10^{-4}$ & 99.88\\
    45 & $9.54*10^{-1}$ & $-2.06*10^{-3}$ & $3.20*10^{-6}$ & $-3.02*10^{-9}$ & $5.24*10^{-4}$ & 99.89\\
    \bottomrule
    \end{tabular}%
}%
[Polarization curve data fitting of clamping pressure testing]{%
Polarization curve data fitting of clamping pressure testing\\ Model: $\frac{U}{V} = b_0 + b_1  \frac{i}{\unitfrac[]{\text{mA}}{\text{cm}^2}} + b_2 \frac{i^2}{\left(\unitfrac[]{\text{mA}}{\text{cm}^2}\right)^2} + b_3 \frac{i^3}{\left(\unitfrac[]{\text{mA}}{\text{cm}^2}\right)^3}$}{tab:3}
\end{center}
\vfill\clearpage
\end{document}

enter image description here

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.