Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am giving a presentation and therefore I am using the beamer class. I have included some figures and it works, but there is no number after "Figure".

My code:

\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}

Which gives the following frame with the figure:

test

(I am not sure what is causing the problem, therefore I did not delete any package.)

How can I get a number, e.g. Figure 1:?

share|improve this question
2  
You should use \centering instead of \begin{center}\end{center}. Also, you have loaded the graphicx package 3 times and hyperref twice. beamer I believe automatically loads graphicx so you shouldn't need it at all. –  dustin Aug 7 '13 at 14:54
1  
Others have answered your question, but to note the reasoning. In a presentation, cross-refs by number are usually a bad idea. So the standard beamer settings are not to have any such cross-ref numbers. –  Joseph Wright Aug 7 '13 at 15:36
2  
@JenBohold Please make your example minimal the next time. –  Svend Tveskæg Aug 7 '13 at 18:06

2 Answers 2

up vote 23 down vote accepted

To achieve numbering of figures, you need to set:

\setbeamertemplate{caption}[numbered]

enter image description here

\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}
share|improve this answer
    
I thought it was not recommended to use a floating environment (even though it is not floating here) in a presentation. Shouldn't the ctan.org/pkg/capt-of package be recommended here instead? –  pluton Aug 8 '13 at 5:32
    
@pluton I just took a look at the documentation. It says unless you need other macros capt-of is like using [H]. Granted other macros are probably not needed but I don't think any conflicts will arise either. We can remove float and just use figure without options. –  dustin Aug 8 '13 at 10:13

With the following, there is no space between Figure and the numbering (and no warnings appear, do to the lmodern package):

\documentclass{beamer}

\usepackage{lmodern}
\usepackage{caption}
\DeclareCaptionLabelSeparator{horse}{:\quad} % change according to your needs
\captionsetup{
  labelsep = horse,
  figureposition = bottom % used to get the correct vertical space between the figure and the caption
} 

\setbeamertemplate{caption}[numbered]

\begin{document}

\begin{frame}
  \begin{figure}
    \centering
      \rule{1cm}{1cm}
    \caption{Leprechaun.}
  \end{figure}
\end{frame}

\end{document}

output

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.