1

How to fit the table into the page size in revtex 4.1

\documentclass[%
  aip,
  jap,%
  amsmath,amssymb,
  reprint,%
  ]{revtex4-1}

 \draft

\usepackage{graphicx}% Include figure files
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math
\usepackage{times}
\DeclareGraphicsExtensions{.eps}
\usepackage{epstopdf}
\usepackage{lipsum}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{array}
\usepackage{natbib}
\usepackage{amsmath}
\usepackage{color}
\usepackage{epstopdf}
\usepackage{grffile}
\usepackage{caption}
\usepackage{showframe}
\captionsetup{justification   = raggedright,
          singlelinecheck = false}
\usepackage{boxhandler}
\usepackage{float}

\begin{document}
\begin{table}
\centering
\caption{\label{}}

\begin{ruledtabular}
\begin{tabular}{l*9 {c}}
System & a & b & c & d & e & f & g & h\\
\end{tabular}
\end{ruledtabular}
\end{table}
\end{document}
2
  • How you mean "whole page" ? Its width to be equal text width? Or text height and be only it on the page?
    – Zarko
    Nov 26, 2015 at 13:08
  • Note that \draft is deprecated by revtex4-1; also \caption is not to be used with it.
    – egreg
    Nov 26, 2015 at 23:40

1 Answer 1

2

Edit: I assume, that with "whole page" you mean over both columns in two column text. In this case you need to use

\begin{table*} ... \end{table*}

however table will be moved to the next page. There is one more limitations. At use of tabularx and columns of type X, the width of this columns is wrong interpreted: each take width of whole table. So it is better to use tabular* and columns p{...} or others (c, l, r, m{...}).

\documentclass[%
  aip,
  jap,%
  amsmath,amssymb,
  reprint,%
  ]{revtex4-1}

\usepackage{graphicx}% Include figure files
\DeclareGraphicsExtensions{.eps}
\usepackage{epstopdf}

\usepackage{times,bm}

\usepackage{array,booktabs,tabularx}
\usepackage{dcolumn}% Align table columns on decimal point
\newcolumntype{C}{>{\centering\arraybackslash}X}

\usepackage{natbib}
\usepackage{color}
\usepackage{grffile}
\usepackage{caption}
\captionsetup{justification   = raggedright,
              singlelinecheck = false}
\usepackage{boxhandler}
\usepackage{float}

\usepackage{lipsum}
\usepackage{showframe}

    \begin{document}
\lipsum[1-3]
    \begin{table*}[htb]
\centering
    \caption{}
\label{}
    \begin{ruledtabular}
\begin{tabular*}{\hsize}{l*9{p{0.08\hsize}}}
System & a & b & c & d & e & f & g & h\\
\end{tabular*}
    \end{ruledtabular}
\end{table*}

\lipsum[4-8]
    \begin{table*}[htb]
\centering
    \caption{}
\label{}
    \begin{ruledtabular}
\begin{tabular*}{\hsize}{l*9{p{0.08\hsize}}}
System & a & b & c & d & e & f & g & h\\
System & a & b & c & d & e & f & g & h\\
\end{tabular*}
    \end{ruledtabular}
\end{table*}

\lipsum[9-13]
    \begin{table*}[htb]
\centering
    \caption{}
\label{}
    \begin{ruledtabular}
\begin{tabular*}{\hsize}{l*9{p{0.08\hsize}}}
System & a & b & c & d & e & f & g & h\\
System & a & b & c & d & e & f & g & h\\
System & a & b & c & d & e & f & g & h\\
\end{tabular*}
    \end{ruledtabular}
\end{table*}
    \end{document}

enter image description here

7
  • But I cannot comment all other packages.. what is the solution in that case?
    – user87834
    Nov 26, 2015 at 16:24
  • You just use them. For showing a solution they are not necessary. They will not change anything in your use. I was on the way and on my laptop I haven't installed them ...
    – Zarko
    Nov 26, 2015 at 17:07
  • @user87834, after installing revtex package and seeing, what it produce, I rewrote my answer with considering assumption, that you have two column text and you like to have tables, which span both columns. Now are used all packages from your MWE, however with tiny difference: each is only one-time loaded in preamble.
    – Zarko
    Nov 26, 2015 at 18:51
  • The extra square appears above and on the sides. that is not required. How to remove them.
    – user87834
    Nov 26, 2015 at 19:27
  • Just comment or remove \usepackage{showframe}. Its function is only to show page layout (by it is shown, that table fit text width) . Box above show place for page header. In a real page it has not to be used.
    – Zarko
    Nov 26, 2015 at 19:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .