131

I am trying to remove the caption prefix, "Figure", for my figures in beamer. I tried doing this but it made no difference.

Heres a minimum working example: As you can see, I have included the caption package.

\documentclass{beamer}

\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{subfig}
\usepackage{epstopdf}
\usepackage{hyperref}
\usepackage{amsmath}
\usepackage[labelformat=empty]{caption}
\usepackage{setspace}
\usepackage[T1]{fontenc}
\usepackage[super,numbers,sort&compress]{natbib}
\usepackage[labelformat=empty]{caption}

% \usepackage{makeidx}
% \usepackage{sidecap}

\setbeamertemplate{footline}[page number]
%\setbeamercolor{structure}{bg=yellow, fg=black}
\usetheme{CambridgeUS}


\logo{%
\includegraphics[scale=0.25]{logo1}%
\hspace{\dimexpr\paperwidth-4cm}
\includegraphics[height=1cm]{logo2}%
}%


\begin{document}


\title[PT]{Presentation Title}
\author[Author1]{List of Authors}
\institute[Univ]{University Name}

\begin{frame} % Cover slide
\titlepage
\end{frame}



\frame{
\frametitle{Evaporating liquid film, G=0.0, S=100, M=35.1, Pr=7.02, E=0.0001, R=0}


\begin{figure}
 \begin{center}
   \includegraphics[scale=0.21]{/home/userid/Research/Dissertation/wigner/montage_evap/Evap_zg_2wl}
    \caption{Wavenumber k=2}
 \end{center}
\end{figure}



} 
5
  • Have you seen this one tex.stackexchange.com/q/3303/18674 ? Commented Nov 12, 2012 at 20:07
  • @BenediktBauer This will still attach the word "Figure" before my caption. I am trying to get rid of the word "Figure"
    – dearN
    Commented Nov 12, 2012 at 20:08
  • Not using a figure environment maybe? Put it inside a block etc.
    – percusse
    Commented Nov 12, 2012 at 20:23
  • @percusse But how can I not use a figure env. as I need figures? Plus I have 80+ pages of figures. this doesnt sound like a fun exercise! :P
    – dearN
    Commented Nov 12, 2012 at 20:24
  • 3
    figure environment is not needed to include figures. Just use \includegraphics... directly and you'll see what I mean. You don't need floats in beamer as they are placed directly on the same slides..
    – percusse
    Commented Nov 12, 2012 at 20:26

7 Answers 7

105

Renew caption template

\documentclass{beamer}


\begin{document}
\setbeamertemplate{caption}{\raggedright\insertcaption\par}

\frame{
\begin{figure}
\rule{5cm}{5cm}
\caption{Test}
\end{figure}
}

\end{document}

No need to load any other packages. You may even add some fancy stuff like a

\setbeamertemplate{caption}{%
\begin{beamercolorbox}[wd=.5\paperwidth, sep=.2ex]{block body}\insertcaption%
\end{beamercolorbox}%
}

Which basically gives you a colored box around the caption (when a color-theme is used).

You can use :

\setbeamertemplate{caption}[default]

if you want to switch back the parameter to its default value, for example if you want the change to be only local.

5
  • OK... so what does this to?
    – dearN
    Commented Nov 12, 2012 at 20:16
  • Removes "Figure". You will see the effect when you compile the code.
    – bloodworks
    Commented Nov 12, 2012 at 20:21
  • 11
    somehow this didn't work, I still see the "Figure" prefix. Commented Nov 18, 2013 at 17:51
  • 7
    @JinghaoShi, this way doesn't work if you use packages like caption. In that case, see @azetina's answer.
    – Emile
    Commented Dec 15, 2015 at 15:53
  • 1
    Make sure you're not using the subcaption package either.
    – nedned
    Commented Dec 9, 2017 at 4:20
71

You can use the caption package:

\documentclass{beamer}

\usepackage{caption}
\captionsetup[figure]{labelformat=empty}% redefines the caption setup of the figures environment in the beamer class.

\begin{document}
\frame{
\begin{figure}
\caption{Test}
\end{figure}

\begin{table}\caption{test}
\centering
\begin{tabular}{|c|c|}
c&c
\end{tabular}
\end{table}}
\end{document}

enter image description here

Notice that since I am only redefining the caption style for figures the rest are left intact as defined by the beamer class.

5
  • 1
    This didn't work for me.
    – dearN
    Commented Nov 12, 2012 at 20:37
  • @drN Why? Isn't that what wanted? That is, to remove the Figure and numbering from the caption?
    – azetina
    Commented Nov 13, 2012 at 0:47
  • perhaps my question should have been clearer: Yes you understand it right. I wanted to remove the prefix "Figure". I had already been able to remove the number. However, \captionsetup[figure]{labelformat=empty} did not work. I am not sure why.
    – dearN
    Commented Nov 13, 2012 at 15:08
  • @drN Probably you had to recompile. That is, delete all .aux files created by the compilation and then compile again with the new setting. Just saying.
    – azetina
    Commented Nov 13, 2012 at 15:14
  • Thanks, this is the one that worked for me. Classic latex: works but only if you're using some random package X.
    – marvin
    Commented Apr 3, 2023 at 18:18
42

The solution is very simple. Just put the caption below the \includegraphics... command with a double left slash. You don't need to use the caption command, only if you need to number figures, which is note very common in a presentation:

\centering
\includegraphics...
\\ <your caption here>
3
  • 1
    This is the simplest option, IMHO. Commented Sep 9, 2018 at 9:04
  • Finally. This worked for my Document class on Texmaker with minipage where everything was failing. Commented Nov 15, 2018 at 18:11
  • This doesn't work for me - the text under this approach did not match the size of the caption text. Commented Nov 22, 2022 at 7:42
12

None of the answers worked for me, I had the same problem. I tried this one in the preamble and it does the job requested:

\captionsetup{labelformat=empty,labelsep=none}
3
  • This is covered in another answer (apart from labelsep=none), so why do you say "[n]one of the answers worked for me"?
    – Werner
    Commented Jun 11, 2016 at 16:45
  • 3
    the only working solution!
    – Sadegh
    Commented Feb 21, 2017 at 11:14
  • I tried this and it added a blank slide at the start of my beamer slides. Any idea why? Commented Nov 22, 2022 at 7:44
9

I've been having trouble with the caption package in Beamer, and the options above using this package weren't working for me.

However, this in the preamble seemed to do the trick:

\setbeamertemplate{caption}{\insertcaption} 
3
  • 2
    I also had some troubles with caption package in beamer. This solution is simple and does the job
    – arunmoezhi
    Commented Nov 28, 2015 at 23:15
  • 1
    Same with me...
    – CroCo
    Commented Jan 11, 2016 at 21:58
  • This did not work for me Commented Nov 22, 2022 at 7:45
4

I use the caption* command instead of caption, which removes the prefix in the Beamer slides.

1
  • This did not work for me. Commented Nov 22, 2022 at 7:46
3

Do not use the commands \begin{figure}, \caption and \end{figure}. Just use \includegraphics[scale=0.4]{fig.eps}

1
  • You can highlight code in your post using back-ticks. To highlight code-blocks, either indent them by four spaces or use the {} on the gui. It is also better to post solutions that compile, a "minimal working example", as this makes it easier for people to appreciate and use your answer. This said, I don't think that you have answered the OPs question...
    – user30471
    Commented Oct 26, 2016 at 12:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .