Thursday, October 13, 2011

Landscape table or image in LaTeX

A thumb rule for landscape table or image in LaTeX:
  1. If you are using latex+dvips+ps2pdf, use the sidewaystable or sidewaysfigure or just sideway environment in rotating package.
  2. If you are on pdflatex, use the landscape environment in pdflscape package instead. sideway prodices a sideway table/figure, but has problem to produce a right landscape view of the page in the pdf file.
For the second option, you might also need the afterpage package to have a properly floating page for the landscape table/figure without a half-blank page before it. The environment is like
\afterpage{
\clearpage
\thispagestyle{plain}
\begin{landscape}
\begin{table}[htp]
% your table here
\end{table}
\end{landscape}
\clearpage
}