有时候,我们需要将LaTeX中的表格旋转90度,如下图所示:
实现代码如下:
\documentclass{article}
\usepackage{times}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{159.0pt}
\usepackage{graphicx}%Put this in the preamble.
\begin{document}
\newsavebox{\tablebox}
\begin{lrbox}{\tablebox}
\begin{tabular}{||l||l||l||l||}
\hline\hline{\textbf{Geographic Location}} &
{\textbf{Site}} &
{\textbf{IP Address}} &
{\textbf{Top Level Directory}} \\
\hline\hline
United States & \tt ftp.shsu.edu & 192.92.115.10 & \it /tex-archive\\
\hline\hline
England & \tt ftp.tex.ac.uk & 131.151.79.32 & \it /tex-archive\\
\hline\hline
Germany & \tt ftp.uni-stuttgart.de & 129.69.8.13 & \it /tex-archive\\
\hline\hline
\end{tabular}
\end{lrbox}
\rotatebox[origin=c]{90}{\usebox{\tablebox}}
\end{document}
如果想让其横着,就需要landscape环境,编译时要dvips ps2pdf,才能正确显示。