55

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?

3 Answers 3

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

4
  • I got it. I used caption2 instead of caption. Now it works. Thanks. Commented Sep 3, 2014 at 2: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
    Commented Sep 3, 2014 at 7:54
  • Hello @Mico you can also add \addtocounter{figure}{-1} after \caption, it works. Commented May 8, 2022 at 8: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
    Commented May 8, 2022 at 8: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}
1
  • 2
    This has the bonus to avoid incrementing the figure counting without the necessity to use \addtocounter{figure}{-1}
    – Daniele
    Commented Mar 11, 2022 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
  • 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. Commented Mar 20, 2019 at 11:06
  • 2
    I guess a `\vspace' could fix the problem. Commented Apr 1, 2019 at 13:56
  • 2
    And now you need to guess the amount of \vspace as well :/ Commented Apr 2, 2019 at 23:18
  • 2
    \vphantom{Figure 1} will match the vertical height of text "Figure 1" without needing to mess with \vspace. See tex.stackexchange.com/questions/165499/…
    – ZaydH
    Commented Jan 9, 2022 at 4:02

You must log in to answer this question.

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