So I am aware that this question has been asked and answered a few times, however I cannot get the existing solutions to work for me.
I have a latex table that is the output from Stata (statistical software) and I am loading it into my existing latex document using the \input{} command. The table is too big, and I need to scale it down.
My table file looks like this:
\begin{table}[htbp]\centering
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\caption{Linear Model, h=10}
\begin{tabular}{l*{5}{c}}
\hline\hline
&\multicolumn{1}{c}{(1)}&\multicolumn{1}{c}{(2)}&\multicolumn{1}{c}{(3)}&\multicolumn{1}{c}{(4)}&\multicolumn{1}{c}{(5)}\\
&\multicolumn{1}{c}{Corrupt Items}&\multicolumn{1}{c}{Corrupt Resources}&\multicolumn{1}{c}{Diversion Items}&\multicolumn{1}{c}{Fraud Items}&\multicolumn{1}{c}{Overinvoiced Items}\\
\hline
model & & & & & \\
T & -0.0226 & -0.0194 & -0.0389 & 0.0000768 & -0.0226 \\
& (-0.99) & (-0.45) & (-1.31) & (0.00) & (-0.99) \\
[1em]
R & 0.00247 & 0.00510 & 0.00379 & -0.00140 & 0.00247 \\
& (0.78) & (0.86) & (0.94) & (-0.54) & (0.78) \\
[1em]
R*T & -0.00539 & -0.0161\sym{*} & -0.00301 & -0.00108 & -0.00539 \\
& (-1.35) & (-2.13) & (-0.58) & (-0.32) & (-1.35) \\
[1em]
Constant & 0.0766\sym{***}& 0.105\sym{**} & 0.0381 & 0.0163 & 0.0766\sym{***}\\
& (4.45) & (3.26) & (1.71) & (1.14) & (4.45) \\
\hline
sigma & & & & & \\
Constant & 0.0441\sym{***}& 0.0827\sym{***}& 0.0531\sym{***}& 0.0352\sym{***}& 0.0441\sym{***}\\
& (9.41) & (9.17) & (6.97) & (6.93) & (9.41) \\
\hline
Observations & 54 & 54 & 54 & 54 & 54 \\
\hline\hline
\multicolumn{6}{l}{\footnotesize All are tobit regressions, censored at 0}\\
\multicolumn{6}{l}{\footnotesize \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\)}\\
\end{tabular}
\end{table}
And then as suggested by this page I attempt to call it and rescale it in this manner:
\documentclass{beamer}
\mode<presentation> {
\usetheme{Madrid}
}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{graphics}
\usepackage{subcaption}
\usepackage{mwe}
\newlength{\tempwidth}
\begin{document}
\begin{frame}
\begin{table}
\let\center\empty
\let\endcenter\relax
\centering
\resizebox{.5\width}{!}{\input{tablefile.tex}}
\end{table}
\end{frame}
\end{document}
Yet, it is still throwing me errors, saying "Not in outer par mode". What is going on here?
\input{tablefile.tex}
without any of the outer table or resizebox then it runs without error and fits on the page. Is this table really an example of the problem? how much smaller do you need it?