Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to fit my large vertical table into one page...

I started with

\documentclass[a4paper,12pt]{report}
\usepackage[pdftex]{graphicx} 
\usepackage{booktabs}
\begin{document}
\rotatebox{90}{
\begin{tabular}{cccccccccccc}
\toprule
&&&&&&&&\multicolumn{4}{c}{\textbf{\% of structures with p-value $<$ 0.1}}\\ \midrule
&&&\textbf{RMSD 0.5}\AA &\textbf{RMSD 25}\AA & \textbf{$\delta$ value} & \textbf{p-value median} & \textbf{p-value average} & \textbf{0.5} \AA & \textbf{1.5} \AA & \textbf{3.0} \AA & \textbf{5.0} \AA \\ \midrule
EROS&without tail&bb&0.78$\pm$0.22&0.60$\pm$0.05&30\%&0.29&3e-9&33\%&53\%&53\%&37\%  \\
&&sc&2.00$\pm$0.38&1.42$\pm$0.08&41\%&0.06&$<$2.2e-16&61\%&79\%&74\%&42\%  \\
\end{tabular}  
}
\end{document}

and the first column is cut... is there any way to fit it nicely to the page?

share|improve this question
    
Make use of \usepackage[margin=1in]{geometry} and put \footnotesize after \rotatebox{90}{. But the fonts will have foot note size though. –  Harish Kumar Sep 21 '12 at 0:30
add comment

1 Answer

There are several ways:

  • Some column headers are much larger than the data in the column, using two or more lines for the header makes smaller column widths.
  • Use of smaller fonts. For example:

    \begingroup
      \small
      \begin{tabular}...\end{tabular}%
    \endgroup
    
  • The distance between columns can be made smaller, see example below.

  • The whole table can put in \resizebox of package graphicx (graphics), e.g.

    \resizebox{\linewidth}{% no space
      \begin{tabular}...\end{tabular}% no space
    }
    

    In your case use \textheight instead of \linewidth.

Caution with spaces by line ends. Inside \resizebox, \rotatebox, … they are set because of horizontal mode, see the comments "no space" in the example above.

The example below uses two lines for some header entries and uses smaller distances between columns.

\documentclass[a4paper,12pt]{report}
\usepackage[pdftex]{graphicx}
\usepackage{booktabs}
\newcommand*{\headtab}[1]{%
  \begin{tabular}[t]{@{}l@{}}#1\end{tabular}%
}
\begin{document}
\noindent
\rotatebox{90}{%
  % shrinking the distance between columns a little bit
  \setlength{\tabcolsep}{.9\tabcolsep}%
  \begin{tabular}{cccccccccccc}
  \toprule
  &&&&&&&&
  \multicolumn{4}{c}{%
    \textbf{\headtab{\% of structures\\with \boldmath$p$-value $<$ 0.1}}}\\
  \midrule
  &&&\textbf{\headtab{RMSD\\0.5\,\AA}} &
  \textbf{\headtab{RMSD\\25\,\AA}} & \textbf{\boldmath$\delta$ value} &
  \textbf{\headtab{p-value\\median}} &
  \textbf{\headtab{p-value\\average}} & \textbf{0.5\,\AA} &
  \textbf{1.5\,\AA} & \textbf{3.0\,\AA} & \textbf{5.0\,\AA} \\ \midrule
  EROS&without
  tail&bb&0.78$\pm$0.22&0.60$\pm$0.05&30\%&0.29&3e-9&33\%&53\%&53\%&37\%  \\
  &&sc&2.00$\pm$0.38&1.42$\pm$0.08&41\%&0.06&$<$2.2e-16&61\%&79\%&74\%&42\%
  \\
  \end{tabular}%
}
\end{document}

Result

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.