[Tex/LaTex] Caption formatting with babel French

babelcaptionsfrench

I have a problem override the default formatting of float captions when using babel’s French option. When babel’s francais setting is chosen, captions are formatted with the label (“Figure X”) in small caps. I'm trying to override that with the caption package, but to no avail. The following minimal example:

\documentclass{article}
\usepackage[labelfont=it]{caption}
\usepackage[francais]{babel}
\usepackage[T1]{fontenc}
\begin{document}
\begin{figure}\caption{xxxxx}\end{figure}
\end{document}

gives

enter image description here

where only the digit is italicized. If I comment out the babel line, it works correctly:

enter image description here

caption’s doc says that it should be loaded after babel to override it, but here it does not seem to be the case. Anyone knows how to work around this issue?

Best Answer

The package babel with the language francais loads the file frenchb.ldf with the following defintion:

\def\figurename{{\scshape Figure}}%

The combination of \itshape\scshape is defined with the current font so you will get the odd result.

I can't understand why babel influences the format.

However you have the following possibilities to solve the issue:

1. Usage of the package caption

You can redefine the name via:

\captionsetup[figure]{name=Figure}

2. Usage of the package babel

\addto\captionsfrancais{%
   \def\figurename{Figure}%
}

Here a complete MWE:

\documentclass{article}
\usepackage[francais]{babel}

\addto\captionsfrancais{%
   \def\figurename{Figure}%
}
\usepackage[T1]{fontenc}
\usepackage[labelfont=it,]{caption}
%\captionsetup[figure]{name=Figure}

\begin{document}
\begin{figure}\caption{xxxxx}\end{figure}


\end{document}
Related Question