4

For some reason I can't redefine the caption from "endash" to "emdash". Gives this kind of error Package caption Error: Undefined labelseparator emdash'. \begin{figure}[H]`

I redefine it with this command

\documentclass[14pt]{article}
\usepackage{caption}\captionsetup[figure]{name={Figure},labelsep=endash}   
\usepackage{graphicx}
\begin{document}
    \begin{figure}
        \includegraphics{image.jpeg}\caption{text}
    \end{figure}
\end{document}

enter image description here

9

On its own the caption package only knows a handful of separators:

  • none
  • colon
  • period
  • space
  • quad
  • newline
  • endash

(yes, my hand has 7 fingers!). You can define your own labelseps using \DeclareCaptionLabelSeparator.

\documentclass[14pt]{article}
\usepackage{caption}
\DeclareCaptionLabelSeparator{emdash}{\textemdash}
\captionsetup[figure]{name={Figure},labelsep=emdash}   
\usepackage{graphicx}
\begin{document}
    \begin{figure}
        \includegraphics{example-image-duck}\caption{text}
    \end{figure}
\end{document}

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.