21

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?

37

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.}
\end{figure}

\end{document}

This gives:

screenshot

  • I got it. I used caption2 instead of caption. Now it works. Thanks. – Mihail Kondratyev Sep 3 '14 at 2:58
  • 4
    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 3 '14 at 7:54
14

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

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

  • 1
    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 at 11:06
  • I guess a `\vspace' could fix the problem. – Marco Stamazza Apr 1 at 13:56
  • 1
    And now you need to guess the amount of \vspace as well :/ – Phelype Oleinik Apr 2 at 23:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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