I would like to use the resize
function from thegraphicx
package to fit a large threeparttable
into a beamer presentation, however I can't seem to get code from examples that you use tabular environments to work. Using the following code:
\documentclass{beamer}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{graphicx,threeparttable,caption}
\begin{document}
\begin{frame}
\begin{table}[h!] \small
\begin{threeparttable}
\caption{\textbf{Descriptive Statistics} \label{tab:descriptivestats}}
\begin{tabular}{ p{3.5cm} p{1.0cm} p{1.0cm} p{1.0cm} p{1.0cm} p{1.0cm}}
\hline
\textbf{Var} & \textbf{Min} & \textbf{Max} & \textbf{Mean} & \textbf{SD} & \textit{N} \\
\hline
\hline
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
XYZ & 0 & 1 & 2 & 3 & 4 \\
\hline
\hline
\end{tabular}
\begin{tablenotes}
\footnotesize
\item \textbf{Note:} XYZ
\end{tablenotes}
\end{threeparttable}
\end{table}
\end{frame}
\end{document}
Any thoughts on how to get this to fit, using resize
or another command?