## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Small font glitch in redefining caption label Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
Cham
Posts: 813
Joined: Sat Apr 02, 2011 4:06 pm

### Small font glitch in redefining caption label

In the book and scrbook classes, I redefined the caption's label using this command in the preamble :
\renewcommand*{\figureformat}{\sffamily\bfseries\figurename~\thefigure}

It's working great, except that I get a new warning in the console (I hate these!) :
LaTeX Font Warning: Font shape T1/cmss/bx/sc' undefined
(Font) using T1/cmss/bx/n' instead on input line 15.

So is there a better way in changing the caption's label style, so we don't get these pesky warnings each time there's a figure in the code ? Here's a MWE to mess with :
\RequirePackage[l2tabu,orthodox]{nag}\documentclass[11pt,twoside,letterpaper,headsepline,footsepline,cleardoublepage=plain,]{scrbook}\renewcommand*{\figureformat}{\sffamily\bfseries\figurename~\thefigure}\usepackage[T1]{fontenc}\usepackage[french]{babel}\usepackage{graphicx}\usepackage{subfig}\usepackage[total={6.25in,10in},left=1.25in,top=0.5in,includehead,includefoot]{geometry} \begin{document} 	\begin{figure}		\centering		\includegraphics[height=4cm]{example-image-a}		\caption{Some caption text.}	\end{figure} \end{document}

EDIT : Notice that the font substitution appears to be a problem with the command \usepackage[french]{babel}. If I remove it, I don't get any warning.

Stefan Kottwitz
Posts: 8523
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
The French style changes the figure label to small caps shape. Since there's no bold small caps in the default font, it's ignored and a warning is issued. You can see the figure labels changing when you temporarily switch to a font that provides bold small caps, such as:

\usepackage{kpfonts}

Stefan

Cham
Posts: 813
Joined: Sat Apr 02, 2011 4:06 pm
So you suggest that I simply ignore these pesky font substitution messages ?

Stefan Kottwitz
Posts: 8523
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
You can switch off that behavior:

\usepackage[french]{babel}\frenchbsetup{SmallCapsFigTabCaptions=false}

Stefan
\usepackage{subfig}\captionsetup{figurename=Figure,margin=1in,format=hang,font=small,format=plain,labelfont={bf,up,sf},textfont={up}}\captionsetup[subfigure]{margin=0cm,font=small,format=plain,labelfont={bf,up},textfont={up}}\captionsetup[table]{name=Table,labelfont={bf,up}}