[Tex/LaTex] Change separator between caption label and number

captionsformattingnumbering

I've tried to accomplish this for some time with the caption package, but with no result. What I want to do is change the following:

Figure 1: text

into

Figure-1: text

I.e. replace the space with a dash.

Best Answer

You find it in section 4 of the manual: you have to define a new label format style. I added only the relevant setup, you can set the other keys as usual.

\documentclass{article}

\usepackage{graphicx}
\usepackage{caption}
\DeclareCaptionLabelFormat{dash}{#1--#2}
\captionsetup[figure]{labelformat=dash}

\begin{document}
\begin{figure}
\centering
\includegraphics[width=5cm]{example-figure-a}
\caption{abc}
\end{figure}
\end{document}

enter image description here