53

I want to make some of my figures just without a number.

Instead of Fig. 1: Caption. I want simply Caption.

I tried to do \caption*, but it doesn't work for me even after using the caption package upgrade.

Maybe there are another ways to do this?

Null
  • 1,525
Mihail Kondratyev
  • 719
  • 1
  • 5
  • 8

3 Answers3

71

You could use \captionsetup from the package caption that way:

\documentclass{article}

\usepackage{caption}

\usepackage{graphicx}

\begin{document}

\begin{figure}[h!] \centering \includegraphics[height=2cm]{figure} \caption{Une figure.} \end{figure}

\begin{figure}[h!] \centering \includegraphics[height=2cm]{figure1} \captionsetup{labelformat=empty} \caption{Une figure.} % \addtocounter{figure}{-1} add this if you want the next figure to be numbered 2 % otherwise it'll be numbered 3 \end{figure}

\end{document}

This gives:

screenshot

Butanium
  • 161
Melian
  • 1,238
  • I got it. I used caption2 instead of caption. Now it works. Thanks. – Mihail Kondratyev Sep 03 '14 at 02:58
  • 13
    With this setup, the next (numbered) figure will be numbered 3 rather than 2. To counteract this presumably unwanted effect, you could type \addtocounter{figure}{-1} before the start of the next figure environment. – Mico Sep 03 '14 at 07:54
  • Hello @Mico you can also add \addtocounter{figure}{-1} after \caption, it works. – Gennaro Arguzzi May 08 '22 at 08:38
  • 2
    @GennaroArguzzi - Thanks. I believe your suggestion is implied by mine. What's crucial is that \addtocounter{figure}{-1} is executed before LaTeX encounters the next numbered figure environment and its associated \caption directive. Whether \addtocounter{figure}{-1} is executed immediately after \caption or sometime later (as long as it's before the next \caption statement) is less important. – Mico May 08 '22 at 08:45
44

You can also use \caption* when using the caption package which keeps only the caption title.

You may do something else what did not work, but this example works as desired:

\documentclass{article}
\usepackage{caption}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure}[ht]
\centering
\includegraphics{figure1}
\caption*{Caption.}
\end{figure}
\end{document}
Stefan Kottwitz
  • 231,401
suppy
  • 441
  • 2
    This has the bonus to avoid incrementing the figure counting without the necessity to use \addtocounter{figure}{-1} – Daniele Mar 11 '22 at 21:47
7

I think the simplest way is to enter the caption not enclosed in the caption{} command.

MWE

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
  \centering
  \includegraphics[width=0.5\textwidth]{Fig_test.png}
  \caption{This with float name and number}
\end{figure}
\begin{figure}
  \centering
  \includegraphics[width=0.5\textwidth]{Fig_test.png}\par
  This with just the caption
\end{figure}
\end{document}

enter image description here

  • 4
    I advise against this approach. Notice that the spacing is inconsistent. The one with the proper \caption macro has about a line worth of vertical space below the picture and the one below has much less than that. – Phelype Oleinik Mar 20 '19 at 11:06
  • 2
    I guess a `\vspace' could fix the problem. – Marco Stamazza Apr 01 '19 at 13:56
  • 2
    And now you need to guess the amount of \vspace as well :/ – Phelype Oleinik Apr 02 '19 at 23:18
  • 2
    \vphantom{Figure 1} will match the vertical height of text "Figure 1" without needing to mess with \vspace. See https://tex.stackexchange.com/questions/165499/vphantom-and-superscripts – ZaydH Jan 09 '22 at 04:02