在我的演示中,我使用框架中的 minipage 格式并排显示两个图形(在投影仪中),每个图形都有简短的副标题。每个图形都编号为 (a) 碳 (b) 铝(图 1)。当我使用另一个带有 minipage 格式的框架和另外两个图形时,它将显示副标题编号为 (c) 铁 (d) 铜(图 2)。这是我所需要的。但是当我有下一个并排两个图形的框架时,我不希望编号为 (e) 碳 (f) 铝(就像图 3 中发生的那样)。下一个为 (g) XXXXX (h) XXXXXX,下一个为 (i) XXXXXX (j) XXXXX,最后是 (y) XXXXXX (z) XXXXX,错误消息显示如下:“计数器太大……”
它应该再次是(a)碳(b)铝(如图 3 所示)。
上述代码片段如下:
\documentclass{beamer}
\usepackage{natbib}
\usetheme{Warsaw}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{xcolor}
\captionsetup{compatibility=false}
\usepackage{fancybox}
\usepackage{multirow}
\usepackage{graphicx}
\usepackage{beamerthemesplit}
\usepackage{amssymb,amsmath,amsthm,latexsym}
\usepackage{amsfonts}
\usepackage{color}
\newcounter{saveenumi}
\newcommand{\seti}{\setcounter{saveenumi}{\value{enumi}}}
\newcommand{\conti}{\setcounter{enumi}{\value{saveenumi}}}
\usepackage{graphics}
\setbeamercovered{highly dynamic}
\subsection*{Multiple Scattered Photons \& Saturation Thickness}
\begin{frame}
\begin{block}{\large Multiple scattered photons versus target thickness}
\begin{figure}
\begin{minipage}{150pt}
\begin{center}
\includegraphics[width=\textwidth]{Figure4_3a.jpg}
\subcaption{Carbon}
\end{center}
\end{minipage}
\hfill
\begin{minipage}{150pt}
\begin{center}
\includegraphics[width=\textwidth]{Figure4_3b.jpg}
\subcaption{Aluminium}
\end{center}
\end{minipage}
\hfill
\end{figure}
\end{block}
\end{frame}
\begin{frame}
\begin{block}{\large Multiple scattered photons versus target thickness (continued...)}
\begin{figure}
\begin{minipage}{150pt}
\begin{center}
\includegraphics[width=\textwidth]{Figure4_3c.jpg}
\subcaption{Iron}
\end{center}
\end{minipage}
\hfill
\begin{minipage}{150pt}
\begin{center}
\includegraphics[width=\textwidth]{Figure4_3d.jpg}
\subcaption{Copper}
\end{center}
\end{minipage}
\hfill
\end{figure}
\end{block}
\end{frame}
\subsection*{Experimental and MCNP comparison for 75 mm collimator}
\begin{frame}
\begin{block}{\large Multiple scattered photons versus target thickness for 75 mm collimator}
\begin{figure}
\begin{minipage}{150pt}
\begin{center}
\includegraphics[width=\textwidth]{Figure4_4a.jpg}
\subcaption{Carbon}
\end{center}
\end{minipage}
\hfill
\begin{minipage}{150pt}
\begin{center}
\includegraphics[width=\textwidth]{Figure4_4b.jpg}
\subcaption{Aluminium}
\end{center}
\end{minipage}
\hfill
\end{figure}
\end{block}
\end{frame}
\end{document}
答案1
要重置计数器,您可以使用\setcounter{subfigure}{0}
。如果您有很多人遇到这个问题,那么这一边已经有一些问题和答案,如何自动完成。
\documentclass{beamer}
\usepackage{natbib}
\usetheme{Warsaw}
\usepackage{caption}
\usepackage{subcaption}
\captionsetup{compatibility=false}
\usepackage{fancybox}
\usepackage{multirow}
\usepackage{beamerthemesplit}
\usepackage{amssymb,amsmath,amsthm,latexsym}
\usepackage{amsfonts}
\newcounter{saveenumi}
\newcommand{\seti}{\setcounter{saveenumi}{\value{enumi}}}
\newcommand{\conti}{\setcounter{enumi}{\value{saveenumi}}}
\setbeamercovered{highly dynamic}
\begin{document}
\begin{frame}
\begin{block}{\large Multiple scattered photons versus target thickness (continued...)}
\begin{figure}
\begin{minipage}{150pt}
\begin{center}
\includegraphics[width=\textwidth]{pic}
\subcaption{Iron}
\end{center}
\end{minipage}
\hfill
\begin{minipage}{150pt}
\begin{center}
\includegraphics[width=\textwidth]{pic}
\subcaption{Copper}
\end{center}
\end{minipage}
\hfill
\end{figure}
\end{block}
\end{frame}
\begin{frame}
\begin{block}{\large Multiple scattered photons versus target thickness for 75 mm collimator}
\setcounter{subfigure}{0}
\begin{figure}
\begin{minipage}{150pt}
\begin{center}
\includegraphics[width=\textwidth]{pic}
\subcaption{Carbon}
\end{center}
\end{minipage}
\hfill
\begin{minipage}{150pt}
\begin{center}
\includegraphics[width=\textwidth]{pic}
\subcaption{Aluminium}
\end{center}
\end{minipage}
\hfill
\end{figure}
\end{block}
\end{frame}
\end{document}
评论:
您不需要xcolor
、或之类的软件包graphicx
,因为 beamer 已经提供了这些功能。color
graphics