When I compile document that has such code:
\usepackage{caption}
\usepackage{subcaption}
\DeclareCaptionLabelSeparator{emdash}{~--- }
\captionsetup[figure]{labelsep=emdash,font=onehalfspacing,position=bottom}
\captionsetup{%
singlelinecheck=off,
skip=2pt,
justification=centering,
}
% ...
\begin{figure}[h]
\centering
\includegraphics[width=0.8\textwidth]{test.png}
\caption{Text here}
\end{figure}
I get error line 54: Undefined control sequence. \caption{Text here}
.
How to resolve this issue?
P.S. Without caption all works properly.
Best Answer
Most likely the error is
labelsep=emdash
.Either the declaration has been forgotten or it's easy to define
emdash
: