我有 6 个图形和 1 个表格。我计划按以下方式排列它们,第一行并排有 4 个图形。第二行有 [图形 图形 表格]。
\begin{document}
\begin{block}{Results}
\begin{minipage}{\textwidth}
\begin{figure} % "[t!]" placement specifier just for this example
\begin{subfigure}{0.24\textwidth}
\includegraphics[width=\linewidth]{c_cs.eps}
\end{subfigure}
\begin{subfigure}{0.24\textwidth}
\includegraphics[width=\linewidth]{soft.eps}
\end{subfigure}
\begin{subfigure}{0.24\textwidth}
\includegraphics[width=\linewidth]{c_kernel.eps}
\end{subfigure}
\begin{subfigure}{0.24\textwidth}
\includegraphics[width=\linewidth]{C_gl_abs_lambda=10-3.eps}
\end{subfigure}
\end{figure}
\end{minipage}
\begin{minipage}[b]{0.48\textwidth}
\begin{figure}
\begin{subfigure}{0.5\textwidth}
\includegraphics[width=\linewidth]{C_mtl_hinge_lambda=10-3.eps}
\end{subfigure}
\begin{subfigure}{0.5\textwidth}
\includegraphics[width=\linewidth]{C_mmmf_hinge_lambda=10-5.eps}
end{subfigure}
\end{figure}
\end{minipage}
\begin{minipage}
\begin{table}
%\vspace{0.3cm}
\noindent\begin{tabularx}{\textwidth}{cccc}
\toprule
per iteration (s) &\vtop{\hbox{\strut Dimensionality}\hbox{\strut Reduction}} & Linear SVM &Kernel SVM \\\midrule
FISTA & $5$ & $21$ & $ 0.1052$ \\\bottomrule
\end{tabularx}\vspace{-0.3cm}\caption{Running time}\label{tab rt}
\end{table}
\end{minipage}
\end{block}
\end{document}
答案1
以下是使用minipage
s 的一个选项:
\documentclass{beamer}
\usetheme{Boadilla}
\usepackage{tabularx}
\usepackage{booktabs}
\begin{document}
\begin{frame}
\begin{block}{Results}
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=.475\linewidth]{example-image-a}~%
\includegraphics[width=.475\linewidth]{example-image-a}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=.475\linewidth]{example-image-a}~%
\includegraphics[width=.475\linewidth]{example-image-a}
\end{minipage}\par\medskip
\begin{minipage}{.5\textwidth}
\centering
\includegraphics[width=.475\linewidth]{example-image-b}~%
\includegraphics[width=.475\linewidth]{example-image-b}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\centering
\begin{tabularx}{.9\linewidth}{XX}
\toprule
header1 & header2 \\
\midrule
text & text \\
text & text \\
\bottomrule
\end{tabularx}
\end{minipage}
\end{block}
\end{frame}
\end{document}
如果子图需要子标题,您可以subfig
使用该caption=false
选项加载包并使用其\subfloat
命令:
\documentclass{beamer}
\usepackage[caption=false]{subfig}
\usepackage{tabularx}
\usepackage{booktabs}
\usetheme{Boadilla}
\begin{document}
\begin{frame}
\begin{block}{Results}
\begin{figure}
\begin{minipage}{.5\textwidth}
\centering
\subfloat[the first subfigure]{\includegraphics[width=.475\linewidth]{example-image-a}}~%
\subfloat[the second subfigure]{\includegraphics[width=.475\linewidth]{example-image-a}}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\centering
\subfloat[the third subfigure]{\includegraphics[width=.475\linewidth]{example-image-a}}~%
\subfloat[the fourth subfigure]{\includegraphics[width=.475\linewidth]{example-image-a}}
\end{minipage}\par\medskip
\begin{minipage}{.5\textwidth}
\centering
\subfloat[the fifth subfigure]{\includegraphics[width=.475\linewidth]{example-image-b}}~%
\subfloat[the sixth subfigure]{\includegraphics[width=.475\linewidth]{example-image-b}}
\end{minipage}%
\begin{minipage}{.5\textwidth}
\centering
\begin{tabularx}{.9\linewidth}{XX}
\toprule
header1 & header2 \\
\midrule
text & text \\
text & text \\
\bottomrule
\end{tabularx}
\end{minipage}
\end{figure}
\end{block}
\end{frame}
\end{document}