1

I want to show my regression table on my beamer presentation. However, I am facing difficulties adjusting the table size in both the normal document and the presentation. Plus, is there a way to attach something on a line that opens another embedded LaTeX page containing the table?

The code of the table is:

\documentclass[]{article}
\setlength{\pdfpagewidth}{8.5in} \setlength{\pdfpageheight}{11in}
\begin{center}
\begin{document}
\begin{tabular}{lccccc} \hline
 & (1) & (2) & (3) & (4) & (5) \\
VARIABLES & IV First Stage & Jute Acres per Cap & Jute Output Per Cap & Jute Yield & Rice Acres Per Cap \\ \hline
 &  &  &  &  &  \\
Log Distance from Border & -0.555*** &  &  &  &  \\
 & (0.0680) &  &  &  &  \\
Jute Acres/100, 1931 & -0.00217*** & 0.0126*** & 1.152*** & 0.0432 & 0.0590*** \\
 & (0.000551) & (0.00113) & (0.0945) & (0.0353) & (0.0205) \\
Pop. Density/100, 1956 & -0.0762*** & 0.0423 & 4.346 & 10.50*** & 1.458** \\
 & (0.0181) & (0.0395) & (3.307) & (1.237) & (0.719) \\
Big City Dummy & 0.327 & -0.462 & -44.05 & -18.21 & -13.28 \\
 & (0.235) & (0.471) & (39.43) & (14.75) & (8.576) \\
Male Literacy, 1956 & 0.0311*** & -0.0215 & -1.757 & -1.916*** & -0.794*** \\
 & (0.00658) & (0.0151) & (1.262) & (0.472) & (0.274) \\
Minority Share, 1931 & 0.0573*** & -0.0230 & -2.353 & -0.247 & -1.693*** \\
 & (0.00584) & (0.0229) & (1.915) & (0.716) & (0.416) \\
Nadia Dummy & 2.060*** & -0.981 & -51.70 & -3.872 & -19.71 \\
 & (0.728) & (1.568) & (131.3) & (49.14) & (28.57) \\
Sqrt. of Migrant Share &  & 0.723*** & 61.53*** & 2.799 & 15.61*** \\
 &  & (0.244) & (20.45) & (7.652) & (4.448) \\
Constant & 2.820*** & 0.112 & 10.59 & 34.17*** & 37.28*** \\
 & (0.433) & (0.340) & (28.45) & (10.64) & (6.187) \\
 &  &  &  &  &  \\
Observations & 182 & 182 & 182 & 182 & 182 \\
R-squared &  & 0.460 & 0.502 & 0.380 & -0.113 \\
 KP F Statistic &  & 66.43 & 66.43 & 66.43 & 66.43 \\ \hline
\multicolumn{6}{c}{ Standard errors in parentheses} \\
\multicolumn{6}{c}{ *** p$<$0.01, ** p$<$0.05, * p$<$0.1} \\
\end{tabular}
\end{document}
\end{center}

The code I'm trying on beamer

\begin{frame}{Final Table}
\begin{small}
\centering
        \adjustbox{max height=\dimexpr\textheight-5.5cm\relax,
            max width=.9\textwidth}{
\include{table}
}
\end{small}   
\end{frame}
New contributor
Eric is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

1 Answer 1

0

This is he same table that fit in both the article and the presentation without any link.

If this data are not the final results and you want/need update often both document with a single edit, you can remove from \begin{tabulary} to \end{tablary} in both documents and paste it in an completely empty file (said table.tex) and then just add \input{table} mwe1 mwe2

\documentclass{beamer}
\usepackage{tabulary}
\usepackage{booktabs}
\begin{document}
\begin{frame}{Final Table}
\tiny
\begin{tabulary}{\linewidth}{LCCCCC} \toprule
 & (1) & (2) & (3) & (4) & (5) \\
VARIABLES & IV First Stage & Jute Acres per Cap & Jute Output Per Cap & Jute Yield & Rice Acres Per Cap \\\midrule
Log Distance from Border & -0.555*** &  &  &  &  \\
 & (0.0680) &  &  &  &  \\
Jute Acres/100, 1931 & -0.00217*** & 0.0126*** & 1.152*** & 0.0432 & 0.0590*** \\
 & (0.000551) & (0.00113) & (0.0945) & (0.0353) & (0.0205) \\
Pop. Density/100, 1956 & -0.0762*** & 0.0423 & 4.346 & 10.50*** & 1.458** \\
 & (0.0181) & (0.0395) & (3.307) & (1.237) & (0.719) \\
Big City Dummy & 0.327 & -0.462 & -44.05 & -18.21 & -13.28 \\
 & (0.235) & (0.471) & (39.43) & (14.75) & (8.576) \\
Male Literacy, 1956 & 0.0311*** & -0.0215 & -1.757 & -1.916*** & -0.794*** \\
 & (0.00658) & (0.0151) & (1.262) & (0.472) & (0.274) \\
Minority Share, 1931 & 0.0573*** & -0.0230 & -2.353 & -0.247 & -1.693*** \\
 & (0.00584) & (0.0229) & (1.915) & (0.716) & (0.416) \\
Nadia Dummy & 2.060*** & -0.981 & -51.70 & -3.872 & -19.71 \\
 & (0.728) & (1.568) & (131.3) & (49.14) & (28.57) \\
Sqrt. of Migrant Share &  & 0.723*** & 61.53*** & 2.799 & 15.61*** \\
 &  & (0.244) & (20.45) & (7.652) & (4.448) \\
Constant & 2.820*** & 0.112 & 10.59 & 34.17*** & 37.28*** \\
 & (0.433) & (0.340) & (28.45) & (10.64) & (6.187) \\
 &  &  &  &  &  \\
Observations & 182 & 182 & 182 & 182 & 182 \\
R-squared &  & 0.460 & 0.502 & 0.380 & -0.113 \\
 KP F Statistic &  & 66.43 & 66.43 & 66.43 & 66.43 \\ \bottomrule
\multicolumn{6}{l}{ Standard errors in parentheses} \\
\multicolumn{6}{l}{ *** p$<$0.01, ** p$<$0.05, * p$<$0.1} \\
\end{tabulary}
\end{frame}
\end{document}

\documentclass[]{article}
\setlength{\pdfpagewidth}{8.5in} \setlength{\pdfpageheight}{11in}
\usepackage{tabulary}
\usepackage{booktabs}
\begin{document}
\begin{tabulary}{\linewidth}{LCCCCC} \toprule
 & (1) & (2) & (3) & (4) & (5) \\
VARIABLES & IV First Stage & Jute Acres per Cap & Jute Output Per Cap & Jute Yield & Rice Acres Per Cap \\\midrule
Log Distance from Border & -0.555*** &  &  &  &  \\
 & (0.0680) &  &  &  &  \\
Jute Acres/100, 1931 & -0.00217*** & 0.0126*** & 1.152*** & 0.0432 & 0.0590*** \\
 & (0.000551) & (0.00113) & (0.0945) & (0.0353) & (0.0205) \\
Pop. Density/100, 1956 & -0.0762*** & 0.0423 & 4.346 & 10.50*** & 1.458** \\
 & (0.0181) & (0.0395) & (3.307) & (1.237) & (0.719) \\
Big City Dummy & 0.327 & -0.462 & -44.05 & -18.21 & -13.28 \\
 & (0.235) & (0.471) & (39.43) & (14.75) & (8.576) \\
Male Literacy, 1956 & 0.0311*** & -0.0215 & -1.757 & -1.916*** & -0.794*** \\
 & (0.00658) & (0.0151) & (1.262) & (0.472) & (0.274) \\
Minority Share, 1931 & 0.0573*** & -0.0230 & -2.353 & -0.247 & -1.693*** \\
 & (0.00584) & (0.0229) & (1.915) & (0.716) & (0.416) \\
Nadia Dummy & 2.060*** & -0.981 & -51.70 & -3.872 & -19.71 \\
 & (0.728) & (1.568) & (131.3) & (49.14) & (28.57) \\
Sqrt. of Migrant Share &  & 0.723*** & 61.53*** & 2.799 & 15.61*** \\
 &  & (0.244) & (20.45) & (7.652) & (4.448) \\
Constant & 2.820*** & 0.112 & 10.59 & 34.17*** & 37.28*** \\
 & (0.433) & (0.340) & (28.45) & (10.64) & (6.187) \\
 &  &  &  &  &  \\
Observations & 182 & 182 & 182 & 182 & 182 \\
R-squared &  & 0.460 & 0.502 & 0.380 & -0.113 \\
 KP F Statistic &  & 66.43 & 66.43 & 66.43 & 66.43 \\ \bottomrule
\multicolumn{6}{l}{ Standard errors in parentheses} \\
\multicolumn{6}{l}{ *** p$<$0.01, ** p$<$0.05, * p$<$0.1} \\
\end{tabulary}
\end{document}
3
  • Hi, I ran into some issues with respect to beamer. I keep getting the error: Overfull \hbox error. If I try to include \input{table}, the overleaf document disappears. I tried to include:\begin{adjustbox}{width=\textwidth,height=\textheight,keepaspectratio}. It improves the formatting in table.tex but the code in the beamer presentation does not seem to work.
    – Eric
    2 days ago
  • The Overfull \hbox are warnings, not errors. It is nothing terrible when they are small (0.5-2 pt) and you cannot note the issue inspecting visually the PDF. About the \input issue, with \documentclass{beamer} \usepackage{tabulary} \usepackage{booktabs} \begin{document} \begin{frame}{Final Table} \tiny \input{table} \end{frame} \end{document} I obtain exactly the same ouptut, so you are doing something wrong, as put table.tex in the wrong place or maybe table.tex is not exactly the removed tabulary environment, but from here I can only guess ...
    – Fran
    2 days ago
  • Found the error: I was using this speficiation: \newcolumntype{L}[1]{>{\raggedright\arraybackslash}m{#1}} \newcolumntype{C}[1]{>{\centering\arraybackslash}m{#1}}
    – Eric
    2 days ago

Your Answer

Eric is a new contributor. Be nice, and check out our Code of Conduct.

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.