# Edit style for italic caption

I have a style for Fig caption like below.

\def\fnum@figure{\small\it\bf\figurename{} \thefigure.}


This style change the caption and caption number bold. But I need bold and italic numbering and only italic for caption like below.

Fig 1.3: This is my caption

Any solution?

I have a style file and this file has a command like below.

\captionsetup{compatibility=false}


So \captionsetup[figure]{font={it,bf}} not worked.

In this style file there is a command \newcommand{\captionfonts}{\normalfont}

Can I edit this command and how?

@Werner I have tried your solution it works at a new document, but in my exist document its not work :( No any change.

• \it\bf? neither \it nor \bf have been defined by default in latex since 1993, if they are defined for compatibility they do not combine, \it\bf is the same as \bf, you want \itshape\bfseries – David Carlisle Jan 6 '20 at 20:04
• Can you supply the \documentclass you're using? – Werner Jan 6 '20 at 20:44
• Without knowing more information, it's not possible to help you. Please supply a minimal document that starts with \documentclass and ends with \end{document} that replicates your current problem. Can you do that? – Werner Jan 6 '20 at 21:09
• If you have to use a particular style, why are you trying to override it? – egreg Jan 6 '20 at 22:47

You need to use

\captionsetup[figure]{
font = it,
labelfont = bf
}


which sets the entire caption font in italics, adding boldface only to the labelfont (which contains the float type, number and separator).

\documentclass{article}

\usepackage{caption}
\captionsetup{
compatibility = false
}

% Set up caption options for figures
\captionsetup[figure]{
font = it,
labelfont = bf
}

\begin{document}

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

\end{document}


Of course, this only works if you are using a \documentclass that is patchable by caption.

Why not simply load the caption package and use

\captionsetup[figure]{font=it, labelfont+=bf} ?