17

enter image description here

I have met a simple problem, that why is the figure's number not shown up in beamer?

The code I used is as below,

\documentclass[12pt]{beamer}
\usepackage{caption}
\usepackage{booktabs} 
\usepackage[sort]{natbib}
\usepackage{grffile,threeparttable}
\usepackage{graphicx,subfig} 
\graphicspath{{F:/}}
\begin{document}
\begin{frame}{Ev}
Sty
\begin{figure}[htp] 
    \centering
\caption{Response to}
    \includegraphics[width=3.3in,scale=0.3]{u}
\end{figure}
\end{frame}

\end{document}

Thanks for any help!

Carl
  • 469

2 Answers2

39

This is conceptual rather than technical decision by the original author of beamer, Till Tantau. When giving a presentation, the expectation is that the presenter will talk about figures (or other details) whilst they are on the screen. Moving through the talk, referring back to 'Figure X' is unlikely to help as either

  • The talk is illustrative and the audience do not have handouts or similar to refer back to
  • The talk is for teaching and any vital figures will be named or close by in the handout

In either case, saying 'As we saw in Figure X' will not be helpful to the audience: if a figure is vital it can be repeated so a visual comparison can be made.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • 1
    It is very good! – Carl Jul 02 '17 at 08:15
  • 1
    it still helps if the audience wants to ask about a figure later on where it was not obvious whether their then-question would not be explained a couple of slides later – Tobias Kienzler Jul 03 '17 at 09:21
  • Figures numbers are useful when the theme used doesn't show the frames numbers. Okay, it is as uneasy to find the \setbeamertemplate{caption}[numbered] command than the \setbeamertemplate{footline}[frame number] one, but at least the former doesn't add at the bottom of the frames an extra line (which is annoying with some themes). – Denis Bitouzé Jul 04 '17 at 19:43
  • @DenisBitouzé I'm in two minds about frame numbers: I've heard reasonable arguments that they simply distract the audience ('Oh, only X slides to go'). My experience is people tend to ask for 'The figure about YYY' rather than 'The one on slide X'. – Joseph Wright Jul 04 '17 at 19:45
  • When you say 'Oh, only X slides to go', do you mean the case when total number of frames is shown? In such a case, I agree; otherwise, I don't see your point. And I'm not sure to understand what you mean with 'The figure about YYY': what is 'YYY'? – Denis Bitouzé Jul 04 '17 at 19:50
  • @DenisBitouzé YYY = 'What the figure is about'. So I might here 'Could you bring up the figure showing the NMR data for your lead compound, it was just before the one showing your other results'. – Joseph Wright Jul 04 '17 at 19:52
  • Mmmmhhh, a numbered figure would probably be easier for the audience. I just happen to received today presentations from students of mine (who learned LaTeX and Beamer with me) and some of them were speaking so fast and passed by too quickly from one frame to the next one that I was happy when either the figures or the frames had numbers :) – Denis Bitouzé Jul 04 '17 at 19:59
  • Your comments are useful! – Carl Jul 05 '17 at 08:40
  • Is there any skill to present a report clearly? – Carl Jul 05 '17 at 08:51
26

However, if you anyway persist to have numbered figures (after reading @Joseph Wright answer at least twice :) ), you need add to preamble:

\setbeamertemplate{caption}[numbered]

i.e.:

\documentclass[12pt,xcolor={svgnames},
               hyperref={colorlinks,linkcolor=blue,citecolor=blue},
               demo]{beamer}
\mode<presentation> {
\usetheme{default}
\usecolortheme{whale}
}
\usepackage{indentfirst,amsmath, multicol,amssymb,threeparttable}
\usepackage{caption}
\usepackage{booktabs}
\usepackage[sort]{natbib}
\usepackage{grffile,threeparttable}
\usepackage{subfig}
\graphicspath{{F:/}}

    \setbeamertemplate{caption}[numbered]% added

\begin{document}
\begin{frame}{Ev}
\begin{figure}[htp]
    \centering
\caption{Response to}
    \includegraphics[width=3.3in,scale=0.3]{u}
\end{figure}
\end{frame}
\end{document}

enter image description here

Note:

  • beamer load graphicx package itself, so loading it again is superfluous
  • beamer has own mechanism for caption, so load caption package is also superfluous
Zarko
  • 296,517