我正在进行演讲,因此我使用beamer
类。我已经添加了一些图形,并且它可以工作,但是“图形”后面没有数字。
我的代码:
\documentclass{beamer}
\usepackage{graphicx}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{eso-pic}
\usepackage{mathrsfs}
\usepackage{url}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{hyperref}
\usepackage{booktabs}
\usepackage{wallpaper}
\usepackage{bbm}
\usepackage{cooltooltips}
\usepackage{eso-pic}
\usepackage{everyshi}
\usepackage{calc}
\usepackage{graphicx}
\usepackage{ifthen}
\usepackage{graphicx}
\usepackage{wrapfig}
\usepackage{animate}
\usepackage[singlespacing]{setspace}
\usepackage[absolute,overlay]{textpos}
\usepackage{enumerate}
\usepackage{hyperref}
\newenvironment{changemargin}[2]{%
\begin{list}{}{%
\setlength{\topsep}{0pt}%
\setlength{\leftmargin}{#1}%
\setlength{\rightmargin}{#2}%
\setlength{\listparindent}{\parindent}%
\setlength{\itemindent}{\parindent}%
\setlength{\parsep}{\parskip}%
}%
\item[]}{\end{list}}
\setbeamercolor{frametitle}{fg=red,bg=white}
\hypersetup{pdfpagemode=FullScreen}
\renewcommand*{\UrlFont}{\normalfont}
\usetheme{Goettingen}
\useinnertheme{circles}
\beamertemplatenavigationsymbolsempty
\setbeamerfont{page number in head/foot}{size=\large}
\setbeamertemplate{footline}[frame number]
%%%
\begin{document}
\frame[plain]{
\titlepage
}
\setbeamertemplate{background canvas}[default]
\frame{
\frametitle{}
\begin{figure}
\begin{center}
\includegraphics[scale=0.2]{varweakness}
\caption{VaR as a quantile}
\end{center}
\end{figure}
}
\end{document}
给出了以下带有图表的框架:
(我不确定是什么导致了这个问题,因此我没有删除任何包。)
我怎样才能获得一个数字?例如Figure 1:
?
答案1
为了实现图形的编号,需要设置:
\setbeamertemplate{caption}[numbered]
\documentclass[demo]{beamer}
\setbeamertemplate{caption}[numbered]
\begin{document}
\begin{frame}
\frametitle{}
\begin{figure}
\centering
\includegraphics{varweakness}
\caption{VaR as a quantile}
\label{something}
\end{figure}
\end{frame}
\end{document}
答案2
您可以使用以下内容:
\documentclass{beamer}
\usepackage{lmodern} % get rid of warnings
\usepackage{caption} % improved spacing between figure and caption
\DeclareCaptionLabelSeparator{horse}{:\quad} % change according to your needs
\captionsetup{
labelsep = horse,
figureposition = bottom
}
\setbeamertemplate{caption}[numbered]
\begin{document}
\begin{frame}
\begin{figure}
\centering
\rule{1cm}{1cm}
\caption{Leprechaun.}
\end{figure}
\end{frame}
\end{document}
请注意,图号和冒号之间没有空格。