我想创建一个幻灯片投影机有 3 个表。我希望两个表并排摆放(如下图所示),第三个表放在它们下面。
我成功地使用 将 2 个表并排放置\quad
。
我目前的代码是:
\begin{frame}
\setlength{\arrayrulewidth}{0.5mm}
\renewcommand{\arraystretch}{1}
\definecolor{wildblueyonder}{rgb}{0.64, 0.68, 0.82}
\newcolumntype{s}{>{\columncolor[HTML]{AAACED}} p{1.5cm}}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{ |l|S|S|c| }
\hline
\rowcolor{lightgray} \multicolumn{4}{|c|}{Classical multiple lm} \\
\hline
\rowcolor{wildblueyonder}
& Estimate & Std. Error & p-value \\
\hline
intercept & 21.8100 & 0.5723 & $<2e-16$ \\
r.limit & 0.4872 & 0.3775 & 0.1997 \\
conc & -0.9541 & 0.0352 & $<2e-16$ \\
log.t & -2.7720 & 0.0377 & $<2e-16$ \\
log.rho & -1.4140 & 0.0186 & $<2e-16$ \\
V.esc & 0.0001 & 0.0001 & 0.2544 \\
V.t & 0.0021 & 0.0044 & 0.6368 \\
Metal & 0.0427 & 0.0145 & 0.0040 \\
\textbf{F test} & \cellcolor{lightgray} & \cellcolor{lightgray} & \textcolor{red}{$<2e-16$} \\
\hline
\end{tabular}
\quad %space between tables
\begin{tabular}{ |l|S|S|c| }
\hline
\rowcolor{lightgray} \multicolumn{4}{|c|}{Canonical multiple lm} \\
\hline
\rowcolor{wildblueyonder}
& Estimate & Std. Error & p-value \\
\hline
intercept & -7.4181 & 0.0067 & $<2e-16$ \\
Comp.1 & -0.2536 & 0.0038 & $<2e-16$ \\
Comp.2 & 0.6747 & 0.0053 & $<2e-16$ \\
Comp.3 & -0.4879 & 0.0645 & $<2e-16$ \\
Comp.4 & -0.0336 & 0.0081 & 0.0001 \\
Comp.5 & 0.1427 & 0.0097 & $<2e-16$ \\
Comp.6 & -2.2291 & 0.0284 & $<2e-16$ \\
Comp.7 & 1.5929 & 0.0409 & $<2e-16$ \\
\textbf{F test} & \cellcolor{lightgray} & \cellcolor{lightgray} & \textcolor{red}{$<2e-16$} \\
\hline
\end{tabular}
\end{adjustbox}
\end{frame}
答案1
我不建议在一张幻灯片上放这么多信息。字体大小需要很小,否则没人能看得清
不要缩放文本,要么减少幻灯片上的文本量,要么使用较小的字体大小。有关更多信息,请查看为什么不缩放包含文本的元素
\documentclass[xcolor=table]{beamer}
\setlength{\arrayrulewidth}{0.5mm}
\renewcommand{\arraystretch}{1}
\definecolor{wildblueyonder}{rgb}{0.64, 0.68, 0.82}
\newcolumntype{S}{>{\columncolor[HTML]{AAACED}}l}
\usepackage{lmodern}
\begin{document}
\begin{frame}
\fontsize{5.5pt}{8pt}\selectfont
\centering
\begin{tabular}{ |l|S|S|c| }
\hline
\rowcolor{lightgray} \multicolumn{4}{|c|}{Classical multiple lm} \\
\hline
\rowcolor{wildblueyonder}
& Estimate & Std. Error & p-value \\
\hline
intercept & 21.8100 & 0.5723 & $<2e-16$ \\
r.limit & 0.4872 & 0.3775 & 0.1997 \\
conc & -0.9541 & 0.0352 & $<2e-16$ \\
log.t & -2.7720 & 0.0377 & $<2e-16$ \\
log.rho & -1.4140 & 0.0186 & $<2e-16$ \\
V.esc & 0.0001 & 0.0001 & 0.2544 \\
V.t & 0.0021 & 0.0044 & 0.6368 \\
Metal & 0.0427 & 0.0145 & 0.0040 \\
\textbf{F test} & \cellcolor{lightgray} & \cellcolor{lightgray} & \textcolor{red}{$<2e-16$} \\
\hline
\end{tabular}
\hfill
\begin{tabular}{ |l|S|S|c| }
\hline
\rowcolor{lightgray} \multicolumn{4}{|c|}{Canonical multiple lm} \\
\hline
\rowcolor{wildblueyonder}
& Estimate & Std. Error & p-value \\
\hline
intercept & -7.4181 & 0.0067 & $<2e-16$ \\
Comp.1 & -0.2536 & 0.0038 & $<2e-16$ \\
Comp.2 & 0.6747 & 0.0053 & $<2e-16$ \\
Comp.3 & -0.4879 & 0.0645 & $<2e-16$ \\
Comp.4 & -0.0336 & 0.0081 & 0.0001 \\
Comp.5 & 0.1427 & 0.0097 & $<2e-16$ \\
Comp.6 & -2.2291 & 0.0284 & $<2e-16$ \\
Comp.7 & 1.5929 & 0.0409 & $<2e-16$ \\
\textbf{F test} & \cellcolor{lightgray} & \cellcolor{lightgray} & \textcolor{red}{$<2e-16$} \\
\hline
\end{tabular}
\smallskip\smallskip
\begin{tabular}{ |l|S|S|c| }
\hline
\rowcolor{lightgray} \multicolumn{4}{|c|}{Canonical multiple lm} \\
\hline
\rowcolor{wildblueyonder}
& Estimate & Std. Error & p-value \\
\hline
intercept & -7.4181 & 0.0067 & $<2e-16$ \\
Comp.1 & -0.2536 & 0.0038 & $<2e-16$ \\
Comp.2 & 0.6747 & 0.0053 & $<2e-16$ \\
Comp.3 & -0.4879 & 0.0645 & $<2e-16$ \\
Comp.4 & -0.0336 & 0.0081 & 0.0001 \\
Comp.5 & 0.1427 & 0.0097 & $<2e-16$ \\
Comp.6 & -2.2291 & 0.0284 & $<2e-16$ \\
Comp.7 & 1.5929 & 0.0409 & $<2e-16$ \\
\textbf{F test} & \cellcolor{lightgray} & \cellcolor{lightgray} & \textcolor{red}{$<2e-16$} \\
\hline
\end{tabular}
\end{frame}
\end{document}
将数据从数据监狱中解放出来
我建议使用这个booktabs
包
\documentclass{beamer}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{frame}
\tiny
\centering
\begin{tabular}{@{}lS[table-format=-2.4]S[table-format=1.4]S[table-format=1e-2,table-comparator = true,table-number-alignment = center]@{}}
\toprule
\multicolumn{4}{c}{Classical multiple lm} \\
\midrule
& {Estimate} & {Std. Error} & {p-value} \\
\cmidrule(rl){2-2} \cmidrule(rl){3-3} \cmidrule(rl){4-4}
intercept & 21.8100 & 0.5723 & <2e-16 \\
r.limit & 0.4872 & 0.3775 & 0.1997 \\
conc & -0.9541 & 0.0352 & <2e-16 \\
log.t & -2.7720 & 0.0377 & <2e-16 \\
log.rho & -1.4140 & 0.0186 & <2e-16 \\
V.esc & 0.0001 & 0.0001 & 0.2544 \\
V.t & 0.0021 & 0.0044 & 0.6368 \\
Metal & 0.0427 & 0.0145 & 0.0040 \\
\midrule
F test & & & <2e-16 \\
\bottomrule
\end{tabular}
\hfill
\begin{tabular}{@{}lS[table-format=-2.4]S[table-format=1.4]S[table-format=1e-2,table-comparator = true,table-number-alignment = center]@{}}
\toprule
\multicolumn{4}{c}{Classical multiple lm} \\
\midrule
& {Estimate} & {Std. Error} & {p-value} \\
\cmidrule(rl){2-2} \cmidrule(rl){3-3} \cmidrule(rl){4-4}
intercept & 21.8100 & 0.5723 & <2e-16 \\
r.limit & 0.4872 & 0.3775 & 0.1997 \\
conc & -0.9541 & 0.0352 & <2e-16 \\
log.t & -2.7720 & 0.0377 & <2e-16 \\
log.rho & -1.4140 & 0.0186 & <2e-16 \\
V.esc & 0.0001 & 0.0001 & 0.2544 \\
V.t & 0.0021 & 0.0044 & 0.6368 \\
Metal & 0.0427 & 0.0145 & 0.0040 \\
\midrule
F test & & & <2e-16 \\
\bottomrule
\end{tabular}
\smallskip
\begin{tabular}{@{}lS[table-format=-2.4]S[table-format=1.4]S[table-format=1e-2,table-comparator = true,table-number-alignment = center]@{}}
\toprule
\multicolumn{4}{c}{Classical multiple lm} \\
\midrule
& {Estimate} & {Std. Error} & {p-value} \\
\cmidrule(rl){2-2} \cmidrule(rl){3-3} \cmidrule(rl){4-4}
intercept & 21.8100 & 0.5723 & <2e-16 \\
r.limit & 0.4872 & 0.3775 & 0.1997 \\
conc & -0.9541 & 0.0352 & <2e-16 \\
log.t & -2.7720 & 0.0377 & <2e-16 \\
log.rho & -1.4140 & 0.0186 & <2e-16 \\
V.esc & 0.0001 & 0.0001 & 0.2544 \\
V.t & 0.0021 & 0.0044 & 0.6368 \\
Metal & 0.0427 & 0.0145 & 0.0040 \\
\midrule
F test & & & <2e-16 \\
\bottomrule
\end{tabular}
\end{frame}
\end{document}