3

I'm having a problem with the memoir, the babel, and caption packages: when compiling a document, the log returns the warning:

Package frenchb.ldf Warning: The definition of \@makecaption has been changed,
(frenchb.ldf)                frenchb will NOT customise it;
(frenchb.ldf)                reported on input line 8.

The thing is that the French babel is supposed to make : an active character, and as a result, put a space before and after it. But since the @makecaption macro is somehow redefined, the spaces are lost. How to force the behaviour for the typography around the : to be correct ?

Here is a MWE:

\documentclass[a4paper,12pt,twoside,openright,final]{memoir}
\usepackage[T1]{fontenc}
\usepackage[english,francais]{babel}
\begin{document}

Blah blah blah (\ref{fig:Figure})

\begin{figure}
\caption{Xxxxx}
\label{fig:Figure}
\end{figure}
\end{document}
3

Solution 1

We use the fact that a colon in French typography should be preceded and followed by a normal interword space.

\documentclass[a4paper,12pt,twoside,openright,final]{memoir}
\usepackage[T1]{fontenc}
\usepackage[english,francais]{babel}

\captiondelim{ : }

\begin{document}

Blah blah blah (\ref{fig:Figure})

\begin{figure}
\caption{Xxxxx}
\label{fig:Figure}
\end{figure}
\end{document}

Solution 2

We teach memoir to use the colon as redefined by babel; this has the advantage that it will give the normal colon if \selectlanguage{english} is issued or we're in the scope of \begin{otherlanguage}{english}.

\documentclass[a4paper,12pt,twoside,openright,final]{memoir}
\usepackage[T1]{fontenc}
\usepackage[english,francais]{babel}

\AtBeginDocument{%
  \begingroup\lccode`~=`:
  \lowercase{\endgroup\captiondelim{~ }}%
}

\begin{document}

Blah blah blah (\ref{fig:Figure})

\begin{figure}
\caption{Xxxxx}
\label{fig:Figure}
\end{figure}
\end{document}

enter image description here

As regards the warning about \@makecaption, I'm afraid you have to keep it or use the silence package for removing it.

|improve this answer|||||
  • Thanks, this indeed works in the MWE (btw, I prefer the second solution). It does not in my full document, but I'll run some tests and try to find what is the additional problem, I will post a comment when found. Or if I have an additional problem ! – Emmanuel Jul 11 '13 at 14:04

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.