我试过了\caption{\label{fig:your-figure}Caption goes here.}
。但是没有用。有人能帮忙吗?
\documentclass[10pt, blue]{beamer}
\mode<presentation>
{
\usetheme{default} % or try Darmstadt, Madrid, Warsaw, ...
\usecolortheme{default} % or try albatross, beaver, crane, ...
\usefonttheme{default} % or try serif, structurebold, ...
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{caption}[numbered]
}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\PassOptionsToPackage{demo}{graphicx}
\begin{document}
\begin{frame}
\centering
\begin{tabular}{c}
(a)\\
\includegraphics[height=3.5cm, width=9cm]{black1}
\end{tabular}
\vspace{0.01em}
\begin{tabular}{c}
(b)\\
\includegraphics[height=3.5cm, width=9cm]{black1}
\end{tabular}
\end{frame}
\end{document}
答案1
要添加标题,您需要将图像放在figure
环境中。使用是tabular
多余的:
\documentclass[10pt, blue, demo]{beamer}
\mode<presentation>
{
\usetheme{default} % or try Darmstadt, Madrid, Warsaw, ...
\usecolortheme{default} % or try albatross, beaver, crane, ...
\usefonttheme{default} % or try serif, structurebold, ...
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{caption}[numbered]
}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
%\PassOptionsToPackage{demo}{graphicx}
\begin{document}
\begin{frame}
\begin{figure}
\centering
% \begin{tabular}{c}
(a)\\
\includegraphics[height=3.5cm, width=9cm]{black1}
% \end{tabular}
\smallskip
% \begin{tabular}{c}
(b)\\
\includegraphics[height=3.5cm, width=9cm]{black1}
% \end{tabular}
\caption{Caption goes here.}
\label{fig:your-figure}
\end{figure}
\end{frame}
答案2
你可以使用这个subcaption
包
\documentclass[10pt, blue]{beamer}
\mode<presentation>
{
\usetheme{default} % or try Darmstadt, Madrid, Warsaw, ...
\usecolortheme{default} % or try albatross, beaver, crane, ...
\usefonttheme{default} % or try serif, structurebold, ...
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{caption}[numbered]
}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\PassOptionsToPackage{demo}{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\begin{subfigure}{1\textwidth}\centering
\caption{This is Caption a}
\includegraphics[height=3.5cm, width=9cm]{black1}
\end{subfigure}
\begin{subfigure}{1\textwidth}\centering
\caption{This is Caption b}
\includegraphics[height=3.5cm, width=9cm]{black1}
\end{subfigure}
\caption{This is a caption for a and b}
\end{figure}
\end{document}
答案3
您没有环境table
,因此\caption
实际上没有任何内容可以添加标题。要么将两个tabular
s 封装在一个table
环境中,要么(我建议在演示中这样做)干脆忘掉\caption
,将描述写成一行简单的文本。