2

I am new to latex and struggling a bit to fit a regression table onto one page (portrait). At the moment I am using \resizebox but cannot quite get it work. I found a similar thread which relies on the adjustbox package but my PC cannot install it for some reason... (Shrink table to fit on a page, or keep it as it is)

Does anyone have any suggestions on how I can shrink the table to fit on one page?

Here is my setup:

\documentclass[12pt]{article}
\usepackage{amsmath,graphicx,amsthm,lscape,setspace}
\usepackage{graphicx}
\usepackage{endnotes}
\usepackage{lscape}
\usepackage{verbatim}
\setlength{\oddsidemargin}{0in}
\setlength{\textwidth}{6.85in}
\setlength{\topmargin}{0in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\textheight}{9in}
\renewcommand{\baselinestretch}{1.46}
\renewcommand{\arraystretch}{1}
\setlength{\evensidemargin}{0in}
\flushbottom

\begin{document}

\renewcommand{\arraystretch}{1.25} \renewcommand{\baselinestretch}{1}
\pagestyle{empty}
\begin{center}
\resizebox{\columnwidth}{!}{%
\begin{tabular}{lcccccccc}
\multicolumn{6}{l}{Table 5.1.  \\
\multicolumn{6}{l}{\scriptsize{Notes text......}} \\
\cline{1-6}
\multicolumn{6}{c}{Panel A}\\
\cline{1-6}
{} & \multicolumn{2}{c}{Purchase Turnover} & & \multicolumn{2}{c}{Sale Turnover}\\
\cline{2-3}  \cline{5-6}
{} & {$(1)$} & {$(2)$} & & {$(1)$} & {$(2)$} \\ 
\cline{1-6}
Experience & -0.148 & -0.0114 &       & -0.0025 & 0.0058 \\
  & (-39.87) & (-4.10) &       & (-1.37) & (2.41) \\
Initial Dependent &       & 0.0857 &       &       & 0.110 \\
  &       & (15.02) &       &       & (7.02)  \\
Lag Dependent &       & 0.126 &       &       & 0.125 \\
  &       & (12.11) &       &       & (9.74)  \\
Lag Return &       & 0.0483 &       &       & 0.0295$ \\
  &       & (7.14) &       &       & (5.01) \\
Intercept & 0.350 & 0.245 &       & 0.0634 & -0.121 \\
  & (50.57) & (2.88) &       & (19.78) & (-1.64) \\
\cline{1-6}
Controls & No & Yes & & No & Yes \\
Year FE & Yes & Yes & & Yes & Yes \\
County FE & Yes & Yes & & Yes & Yes \\
\cline{1-6}
No. Obs. & 129,861 & 84,747 &       & 129,861 & 84,747 \\
Adj. R-sq & 0.128 & 0.075 &       & 0.017 & 0.050 \\
\cline{1-6}
% Panel B
\multicolumn{6}{c}{Panel B - All Households}\\
\cline{1-6}
{} & \multicolumn{2}{c}{Purchase Turnover} & & \multicolumn{2}{c}{Sale Turnover}  \\
\cline{2-3}  \cline{5-6}
{} & {$(1)$} & {$(2)$} & & {$(1)$} & {$(2)$} \\ 
\cline{1-6}
Experience & -0.121 & -0.0004 &       & -0.078 & 0.041 \\
  & (-48.57) & (-2.50) &       & (-1.77) & (2.03) \\
Initial Dependent &       & 0.0997 &       &       & 0.250 \\
  &       & (19.92) &       &       & (7.96)  \\
Lag Dependent &       & 0.116 &       &       & 0.144 \\
  &       & (11.00) &       &       & (7.28)  \\
Lag Return &       & 0.323 &       &       & 0.0258 \\
  &       & (4.58) &       &       & (2.31) \\
Intercept & 0.589 & 0.225 &       & 0.0436 & -0.122 \\
  & (51.57) & (2.11) &       & (15.72) & (-1.51) \\
\cline{1-6}
Controls & No & Yes & & No & Yes  \\
Year FE & Yes & Yes & & Yes & Yes  \\
County FE & Yes & Yes & & Yes & Yes \\
\cline{1-6}
No. Obs. & 1,256,615 & 874,015 &       & 1,256,615 & 874,015 \\
Adj. R-sq & 0.017 & 0.045 &       & 0.007 & 0.026 \\
\cline{1-6}
\end{tabular}%
}
\end{center}

Sorry for such long code! Thank you for the help!!

3

I suggest the following changes in your code:

  • If I correctly understand you'd like to have a table of the same width as the text width. This is simply achievable by using tabularx. For this don't use adjustbox, because the table will become very ugly.
  • the table caption, except for longtable should be outside of tabular environment, so I introduced floating environment table and added the caption package
  • For nice looking tables it is appropriate to use the booktabs packages and its rules: toprule, midrule ... as you can see in code below
  • Your table actually has five columns, not six, so I reduces number of columns
  • with showframe I show that table has a width of text width. For actual use, please remove this package.
  • It seems that in the main text and the table text you would like to have different interline spaces. For this I use the package setspace and put the complete table content between \begin{spacing}{1.0} ... \end{spacing}. You can change this stretch to your wish and taste.

After all these changes I obtain the following:

enter image description here

I didn't retype entire table, missing rows are easy to add.

\documentclass[12pt]{article}
    \usepackage{amsmath,amsthm}
    \usepackage{setspace}
    \usepackage{graphicx}
    \usepackage{endnotes}
    \usepackage{lscape}
    \usepackage{verbatim}

\setlength{\oddsidemargin}{0in}
\setlength{\textwidth}{6.85in}
\setlength{\topmargin}{0in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\textheight}{9in}
\renewcommand{\baselinestretch}{1.46}
\renewcommand{\arraystretch}{1}
\setlength{\evensidemargin}{0in}
\flushbottom

    \usepackage{showframe}% just to show page layout
    \usepackage{caption}
    \usepackage{booktabs, tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\begin{document}
    \pagestyle{empty}

\begin{table}
    \begin{spacing}{1.0}
\caption[Table 5.1]
        {Table 5.1.\medskip\newline
        Notes text......}
\label{tab:mytable}
    \begin{tabularx}{\hsize}{l*{4}{C}}
    \toprule
\multicolumn{5}{c}{Panel A}\\
    \midrule
    &   \multicolumn{2}{c}{Purchase Turnover} 
        & \multicolumn{2}{c}{Sale Turnover}\\
    \cmidrule(r){2-3}  \cmidrule(l){4-5}
    & $(1)$     &  $(2)$    & $(1)$     & $(2)$     \\
    \midrule
Experience 
    & -0.148    & -0.0114   & -0.0025   &   0.0058  \\
    & (-39.87)  & (-4.10)   & (-1.37)   &   (2.41)  \\
Initial Dependent 
    &           & 0.0857    &           &   0.110   \\
    &           & (15.02)   &           &   (7.02)  \\
Lag Dependent 
    &           & 0.126     &           &   0.125   \\
    &           & (12.11)   &           &   (9.74)  \\
Lag Return 
    &           & 0.0483    &           &   0.0295  \\
    &           &           &           &   (5.01)  \\
Intercept 
    &   0.350   & 0.245     &   0.0634  &    -0.121 \\
    &   (50.57) & (2.88)    &   (19.78) &   (-1.64) \\
    \midrule
Controls 
    & No        &   Yes     &   No      &   Yes     \\
Year FE 
    &   Yes     &   Yes     &   Yes     &   Yes     \\
County FE   
    & Yes       &   Yes     &   Yes     &   Yes     \\
    \midrule
No. Obs. 
    & 129,861   & 84,747    &   129,861 & 84,747    \\
Adj. R-sq 
    & 0.128     & 0.075     &   0.017   & 0.050     \\
    \bottomrule
    \addlinespace[1em]
% Panel B
    \multicolumn{5}{c}{Panel B - All Households}    \\
    \midrule
    &   \multicolumn{2}{c}{Purchase Turnover} 
        &   \multicolumn{2}{c}{Sale Turnover}       \\
    \cmidrule(r){2-3}  \cmidrule(l){4-5}
    & $(1)$     &  $(2)$    & $(1)$     & $(2)$     \\
    \midrule
Experience 
    & -0.121    & -0.0004   &   -0.078  &   0.041   \\
    & (-48.57)  & (-2.50)   &   (-1.77) &   (2.03)  \\
Initial Dependent 
    &           & 0.0997    &           &   0.250   \\
    \bottomrule
\end{tabularx}
    \end{spacing}
    \end{table}
\end{document}
0

You mean something like the code below?

(Your code didn't compile: missing curlies, $ instead of \$.)

\documentclass[12pt]{article}
\usepackage{amsmath,graphicx,amsthm,lscape,setspace}
\usepackage{graphicx}
\usepackage{endnotes}
\usepackage{lscape}
\usepackage{verbatim}
\setlength{\oddsidemargin}{0in}
\setlength{\textwidth}{6.85in}
\setlength{\topmargin}{0in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\textheight}{9in}
\renewcommand{\baselinestretch}{1.46}
\renewcommand{\arraystretch}{1}
\setlength{\evensidemargin}{0in}
\flushbottom

\begin{document}

\renewcommand{\arraystretch}{0.8} \renewcommand{\baselinestretch}{1}
\pagestyle{empty}
\begin{center}
\resizebox{4.5in}{!}{%
\begin{tabular}{lcccccccc}
\multicolumn{6}{l}{Table 5.1.}  \\
\multicolumn{6}{l}{\scriptsize{Notes text......}} \\
\cline{1-6}
\multicolumn{6}{c}{Panel A}\\
\cline{1-6}
{} & \multicolumn{2}{c}{Purchase Turnover} & & \multicolumn{2}{c}{Sale Turnover}\\
\cline{2-3}  \cline{5-6}
{} & {$(1)$} & {$(2)$} & & {$(1)$} & {$(2)$} \\ 
\cline{1-6}
Experience & -0.148 & -0.0114 &       & -0.0025 & 0.0058 \\
  & (-39.87) & (-4.10) &       & (-1.37) & (2.41) \\
Initial Dependent &       & 0.0857 &       &       & 0.110 \\
  &       & (15.02) &       &       & (7.02)  \\
Lag Dependent &       & 0.126 &       &       & 0.125 \\
  &       & (12.11) &       &       & (9.74)  \\
Lag Return &       & 0.0483 &       &       & 0.0295 \\
  &       & (7.14) &       &       & (5.01) \\
Intercept & 0.350 & 0.245 &       & 0.0634 & -0.121 \\
  & (50.57) & (2.88) &       & (19.78) & (-1.64) \\
\cline{1-6}
Controls & No & Yes & & No & Yes \\
Year FE & Yes & Yes & & Yes & Yes \\
County FE & Yes & Yes & & Yes & Yes \\
\cline{1-6}
No. Obs. & 129,861 & 84,747 &       & 129,861 & 84,747 \\
Adj. R-sq & 0.128 & 0.075 &       & 0.017 & 0.050 \\
\cline{1-6}
% Panel B
\multicolumn{6}{c}{Panel B - All Households}\\
\cline{1-6}
{} & \multicolumn{2}{c}{Purchase Turnover} & & \multicolumn{2}{c}{Sale Turnover}  \\
\cline{2-3}  \cline{5-6}
{} & {$(1)$} & {$(2)$} & & {$(1)$} & {$(2)$} \\ 
\cline{1-6}
Experience & -0.121 & -0.0004 &       & -0.078 & 0.041 \\
  & (-48.57) & (-2.50) &       & (-1.77) & (2.03) \\
Initial Dependent &       & 0.0997 &       &       & 0.250 \\
  &       & (19.92) &       &       & (7.96)  \\
Lag Dependent &       & 0.116 &       &       & 0.144 \\
  &       & (11.00) &       &       & (7.28)  \\
Lag Return &       & 0.323 &       &       & 0.0258 \\
  &       & (4.58) &       &       & (2.31) \\
Intercept & 0.589 & 0.225 &       & 0.0436 & -0.122 \\
  & (51.57) & (2.11) &       & (15.72) & (-1.51) \\
\cline{1-6}
Controls & No & Yes & & No & Yes  \\
Year FE & Yes & Yes & & Yes & Yes  \\
County FE & Yes & Yes & & Yes & Yes \\
\cline{1-6}
No. Obs. & 1,256,615 & 874,015 &       & 1,256,615 & 874,015 \\
Adj. R-sq & 0.017 & 0.045 &       & 0.007 & 0.026 \\
\cline{1-6}
\end{tabular}%
}
\end{center}

\end{document}


[![enter image description here][1]][1]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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