3

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.

  • Is the "dash" symbol supposed to be a "simple" dash, i.e., a hyphen character, or an "en-dash"? – Mico Jun 13 '12 at 15:29
5

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

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.