[Tex/LaTex] Customize caption name of figures

captionsfloatsformattingnaming

I want to produce a figure caption like the following figure.enter image description here

So I use the following package in the article environment.

\usepackage[format=plain,justification=raggedright,singlelinecheck=false,font=small,labelfont={bf,sf},labelsep=space,figurename=Figure]{caption} 

However, what I get when I use \caption{\sffamily{\textbf{Quantum jumps}}} is
enter image description here

So, how do I get it to display Figure instead of Fig.? Also, how do I get the | next to Figure 1? When I set labelsep=|, I got an error.

Thanks.

Best Answer

Unless you're using a class that isn't compatible with caption, the following should work.

In order to define a | separator, use

\DeclareCaptionLabelSeparator{pipe}{ $|$ }% or $\vert$

enter image description here

\documentclass{article}

\usepackage{caption}
\DeclareCaptionLabelSeparator{pipe}{ $|$ }% or $\vert$
\captionsetup{
  format=plain,
  justification=raggedright,
  singlelinecheck=false,
  font=small,
  font={bf,sf}, % This covers labelfont and textfont
  labelsep=pipe,
  figurename=Figure
}

\begin{document}

\begin{figure}
  \caption{A caption}
\end{figure}

\end{document}
Related Question