我有以下代码(见下文)以良好的方式将 6 张图片放在一张幻灯片中(我从此网站上的另一个问题/答案中获得了此代码)。但是,我不清楚如何为 6 张图片中的每一张图片添加标题。有人可以解释一下吗?
\documentclass[fleqn]{beamer}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{epsfig}
\usepackage{graphicx}
\usepackage{subfigure}
\evensidemargin -1cm \textheight=24.5cm \textwidth=16.cm
\oddsidemargin=0cm \topmargin=-1cm \topskip=0cm \headheight=0cm
\headsep=0cm
\usepackage{beamerthemesplit}
\usetheme{Goettingen}
\usepackage{color}
\begin{frame}
\begin{columns}[t]
\frametitle{Bla}
\column{.3\textwidth}
\centering
\includegraphics[width=3.0cm,height=2.5cm]{pic1}\\
\includegraphics[width=3.0cm,height=2.5cm]{pic4}
\column{.3\textwidth}
\centering
\includegraphics[width=3.0cm,height=2.5cm]{pic2}\\
\includegraphics[width=3.0cm,height=2.5cm]{pic5}
\column{.3\textwidth}
\centering
\includegraphics[width=3.0cm,height=2.5cm]{pic3}\\
\includegraphics[width=3.0cm,height=2.5cm]{pic6}
\end{columns}
\begin{center}
\scalebox{0.8}{%
$E = m c^2$
}
\end{center}
\end{frame}
答案1
像这样?
对于图像放置我建议使用tabularx
:
\documentclass{beamer}
%\usepackage{amsmath}
%\usepackage{amssymb}
%\usepackage{epsfig}
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage{graphicx}
%\usepackage{subfigure}% dont't use, it is obsolete
%\evensidemargin -1cm \textheight=24.5cm \textwidth=16.cm
%\oddsidemargin=0cm \topmargin=-1cm \topskip=0cm \headheight=0cm
%\headsep=0cm
\usepackage{beamerthemesplit}
\usetheme{Goettingen}
%\usepackage{color}% here make option clash, move to beamer option or simple delete
\begin{document}
\begin{frame}[t]
\frametitle{Bla}
\begin{figure}
\begin{tabularx}{\textwidth}{CCC}
\includegraphics[width=3.0cm,height=2cm]{example-image-a}
\caption{fig 1}
& \includegraphics[width=3.0cm,height=2cm]{example-image-b}
\caption{fig 2}
& \includegraphics[width=3.0cm,height=2cm]{example-image-c}
\caption{fig 3}
\\[-3ex]
\includegraphics[width=3.0cm,height=2cm]{example-image-a}
\caption{fig 4}
& \includegraphics[width=3.0cm,height=2cm]{example-image-b}
\caption{fig 5}
& \includegraphics[width=3.0cm,height=2cm]{example-image-c}
\caption{fig 6}
\end{tabularx}\vspace{-3ex}
\end{figure}
\[
\displaystyle E = m c^2
\]
\end{frame}
\end{document}
希望代码足够清晰易懂
答案2
如果您将内容排列在里面tabular
,您就可以轻松管理标题的位置:
\documentclass{beamer}
\let\Tiny\tiny% http://tex.stackexchange.com/a/94159/5764
\usepackage{graphicx}
\usepackage{beamerthemesplit}
\usetheme{Goettingen}
\begin{document}
\begin{frame}
\frametitle{Frame title}
\makebox[\textwidth]{%
\begin{tabular}{ c c c }
\includegraphics[width=3.0cm,height=2.5cm]{example-image-a} &
\includegraphics[width=3.0cm,height=2.5cm]{example-image-b} &
\includegraphics[width=3.0cm,height=2.5cm]{example-image-c} \\
\footnotesize (a) &
\footnotesize (b) &
\footnotesize (c) \\[\medskipamount]
\includegraphics[width=3.0cm,height=2.5cm]{example-image-c} &
\includegraphics[width=3.0cm,height=2.5cm]{example-image-a} &
\includegraphics[width=3.0cm,height=2.5cm]{example-image-b} \\
\footnotesize (d) &
\footnotesize (e) &
\footnotesize (f)
\end{tabular}%
}
\begin{center}
\scalebox{0.8}{%
$E = m c^2$
}
\end{center}
\end{frame}
\end{document}