[Tex/LaTex] How to remove number in Figure caption

captionsnaming

Let's say I have a document with just one figure and I don't want that figure to be labeled 'Figure 1:' but only 'Figure:'

How can I do that?

I tried:

\begin{figure*}

but that didn't work! I also tried

\def\figurename{Figure}

but didn't work either

Best Answer

You didn't provide more details, so I assumed you're using the article class. In this case, you can redefine the figure number to be empty by issuing \renewcommand{\thefigure}{}.

Edit:

If it is necessary also to remove the extra spacing before the colon, one can easily modify the above command to make up for this as:

\renewcommand{\thefigure}{\hspace{-.333333em}}

Here is an example:

\documentclass{article}
\usepackage{graphicx}
\renewcommand{\thefigure}{}
\begin{document}

\begin{figure}[h!]
\centering
\includegraphics[height=2cm]{example-image}
\caption{This is the first figure}
\end{figure}

\begin{figure}[h!]
\centering
\includegraphics[height=2cm]{example-image}
\caption{And this is the second one}
\end{figure}

\end{document}

enter image description here