3

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.

3

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}
  • Hi, I still got Fig. instead or Figure. Is it because I'm using two columns? How do I overcome this? Thanks. – user75521 Nov 3 '16 at 4:10
  • 2
    @user75521: Nope. You must be loading some other package that is interfering. By the way, 8.5pt is not a document class option for article. – Werner Nov 3 '16 at 4:28

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.