Whew...breathe Josh...
Problem: My document contains a long table that fits in landscape but not portrait view. The entire page needs to be rotated including headers and footers.
Solution: What solution!? They can shove it up their... Sorry... got excited again. Thanks to Alan Munn we have a reasonably sophisticated answer. I saw some other ones (simpler ones) that worked too, but this seems to be the most correct within the context of programming in Latex. He posted it here. I took what he had and edited it for the UTK Latex Template. This is the exact code for one of my long tables
\documentclass[letterpaper,12pt]{report}
\usepackage[vcentering,dvips]{geometry} % help with margins
\usepackage[absolute]{textpos}
\usepackage{booktabs}
\usepackage{pdflscape}
\geometry{
letterpaper,
left=1.0in,
top=1.5in,
right=1.0in,
bottom=1.5in,
paperheight=11in,
paperwidth=8.5in,
dvips,
pdftex
}
\pagestyle{fancy}
\fancyhead{} % clear all header fields
%\fancyhead[LE,RO]{\slshape \rightmark}
%\fancyhead[LO,RE]{\slshape \leftmark}
\fancyfoot{} % clear all footer fields
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\fancypagestyle{lscape}{%
\fancyhf{} % clear all header and footer fields
\fancyfoot[LE]{% Left field on EVEN pages
\begin{textblock}{20}(1,5){\rotatebox{90}{}}\end{textblock} % This is for running header info \leftmark or \rightmark
\begin{textblock}{1}(13,10.5){\rotatebox{90}{\thepage}}\end{textblock}}
\fancyfoot[LO] {% Left field on ODD pages
\begin{textblock}{1}(18.75,3.5){\rotatebox{90}{\thepage}}\end{textblock} % this positions the page number
\begin{textblock}{20}(1,13.25){\rotatebox{90}{}}\end{textblock}}% This is for running header info \leftmark or \rightmark
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}
\renewcommand{\headrulewidth}{0.0pt}
\renewcommand{\footrulewidth}{0.0pt}
}
\begin{document}
\newpage
\thispagestyle{lscape}
\begin{landscape}
% EXPERIMENTAL MANTLE LOCATIONS
%===============================================================================================
%\begin{sidewaystable}
\begin{table}
\addtolength{\tabcolsep}{-2.0pt}
\centering % ensure it centers on the page. modify this if centering is not wanted
\caption{Comparison of experimental and computational mantle locations with the complex-lamellar (\text{CL}) and Beltramian (\text{BEL}) models}
\label{Ch:Vortex Sec:MULT Comparison Experimental mantle locations} % this is the label for cross-referencing
%\begin{tabular*}{6.5in}{@{\extracolsep{\fill}} lllllccclcc }
\begin{tabular}{lllllccclcc}
\\
\toprule
& & & & \multicolumn{3}{c}{Experimental} & & \multicolumn{3}{c}{Computational} \\ \cmidrule(){5-7} \cmidrule(){9-11}
$n$ & $\beta_{2,n}^{({\rm CL})}$ & $\beta_{2,n}^{({\rm BEL})}$ & & $\beta_{2,n}^{({\rm EXP})}$ & $\left |\beta_{2,n}^{({\rm CL})}-\beta_{2,n}^{({\rm EXP})} \right |$ & $\left |\beta_{2,n}^{({\rm BEL})}-\beta_{2,n}^{({\rm EXP})} \right |$ & & $\beta_{2,n}^{({\rm CFD})}$ & $\left |\beta_{2,n}^{({\rm CL})}-\beta_{2,n}^{({\rm CFD})} \right |$ & $\left |\beta_{2,n}^{({\rm BEL})}-\beta_{2,n}^{({\rm CFD})} \right | $ \\
\hline
\\[-2.0ex]
0 & 0.408 & 0.236 & & 0.296 & 0.112 & 0.060 & & 0.305 & 0.103 & 0.069 \\
1 & 0.707 & 0.543 & & 0.594 & 0.113 & 0.051 & & 0.385 & 0.322 & 0.158 \\
2 & 0.913 & 0.851 & & 0.803 & 0.110 & 0.048 & & 0.787 & 0.126 & 0.064 \\
\bottomrule
\end{tabular}
\end{table}
%===============================================================================================
\end{landscape}
\end{document}
2 comments:
Hi!
your example seems to be missing a
\usepackage{fancyhdr}
in the header. Also, are the \rmCL and \rmEXP and so on necessary?
Hi!
your example seems to be missing a
\usepackage{fancyhdr}
in the preamble. Also, are all the \rmEXP, etc., really necessary?
Post a Comment