
Pregunta: La tabla no aparece completamente en el marco de mi documento de proyector. Por favor guíame
\documentclass[12pt,fleqn]{beamer}
\usepackage{booktabs}
\begin{document}
\begin{frame}
\frametitle{A large table}
\resizebox{\textwidth}{!}{%
\begin{tabular}{*{5}{c}}
\toprule
$x$ & $y$ & $x^2$ & $y^2$ & $xy$ \\
\midrule
43 & 29 & 1849 & 841 & 1247 \\
44 & 31 & 1936 & 961 & 1364 \\
46 & 19 & 2116 & 361 & 874 \\
40 & 18 & 1600 & 324 & 720 \\
44 & 19 & 1936 & 361 & 836 \\
42 & 27 & 1764 & 729 & 1134 \\
45 & 27 & 2025 & 729 & 1215 \\
42 & 29 & 1764 & 841 & 1218 \\
38 & 41 & 1444 & 1681 & 1558 \\
40 & 30 & 1600 & 900 & 1200 \\
42 & 26 & 1764 & 676 & 1092 \\
57 & 10 & 3249 & 100 & 570\\
\bottomrule
\end{tabular}%
}
\end{frame}
\end{document}
Respuesta1
Nunca lo use \resizebox
con tablas: genera tamaños de fuente inconsistentes y, a veces, tablas ilegibles.
Utilice un entorno que le permita especificar el ancho general de la tabla, como tabular*
o tabularx
. También puedes jugar con los tamaños de fuente estándar ( \small
, etc.) y el valor de \tabcolsep
.
En este caso, propongo el siguiente código, usando `tabular*:
\documentclass[12pt,fleqn]{beamer}
\usepackage{booktabs}
\begin{document}
\begin{frame}
\frametitle{A large table}
\centering\begin{tabular*}{\framewidth}{@{\extracolsep{\fill}}*{5}{c}}
\toprule
$x$ & $y$ & $x^2$ & $y^2$ & $xy$ \\
\midrule
43 & 29 & 1849 & 841 & 1247 \\
44 & 31 & 1936 & 961 & 1364 \\
46 & 19 & 2116 & 361 & 874 \\
40 & 18 & 1600 & 324 & 720 \\
44 & 19 & 1936 & 361 & 836 \\
42 & 27 & 1764 & 729 & 1134 \\
45 & 27 & 2025 & 729 & 1215 \\
42 & 29 & 1764 & 841 & 1218 \\
38 & 41 & 1444 & 1681 & 1558 \\
40 & 30 & 1600 & 900 & 1200 \\
42 & 26 & 1764 & 676 & 1092 \\
57 & 10 & 3249 & 100 & 570\\
\bottomrule
\end{tabular*}
\end{frame}
\end{document}