# Incompatibility between package [francais]{babel} and refcheck

Below is an example that fails, giving, at compilation:

  ! Missing \endcsname inserted.
\penalty
l.10 On identifie \ref{eq:xx}


With only either the \usepackage[francais]{babel} line or the
\usepackage{refcheck} line, it compiles smoothly and gives the result
that I expect.

NB: I have used \usepackage[T1]{fontenc} because with only
\usepackage[francais]{babel} (and without \usepackage{refcheck}), I
get something like:

  Package frenchb.ldf Warning: OT1 encoding should not be used for French.
(frenchb.ldf)                Add \usepackage[T1]{fontenc} to the preamble
(frenchb.ldf)                of your document, on input line 7.


but, whether or not I have this \usepackage[T1]{fontenc}, I see the
same \endcsname error, and, consistently, the same -- incorrect --
output dvi file if compilation is forced with repetitive [enter] keys.

I also tried to change the order of the lines in the preamble.

I could perform the test on two systems:

Linux frac 3.18.7-200.fc21.x86_64 #1 SMP Wed Feb 11 21:53:17 UTC 2015
x86_64 x86_64 x86_64 GNU/Linux

Linux fric 2.6.32-504.8.1.el6.i686 #1 SMP Wed Jan 28 18:25:26 UTC 2015
i686 i686 i386 GNU/Linux


Am I doing something wrong? Could there exist a workaround?

Thank you.

\documentclass{article}

\usepackage[T1]{fontenc}\usepackage[francais]{babel}
\usepackage{refcheck}

\begin{document}

$$\label{eq:xx} x=3$$
On identifie \ref{eq:xx}.

\end{document}

• It works with eqxx... refcheck seems to hate the : character in the label – user31729 Mar 10 '15 at 15:28
• The : character is an active character due to babel. Does : have a special meaning in French language? – user31729 Mar 10 '15 at 15:34
• Welcome to TeX.SX! It's very inconvenient using : in label names when using babel-french – egreg Mar 10 '15 at 15:51
• Why don't you use simply \label{eq-xx}? Would it be incompatible with refcheck? – Bernard Mar 10 '15 at 19:09
• @Christian No, the colon (:) has nothing special in French, i.e., it has exactly the same meaning as in English, to the best of my knowledge. Only the typographic rules related to it are generally assumed different -- basically: space before and after in French instead of no space before, space after in English; but this might depend on editorial policies: it is not uncommon to find the English convention in French books/newspapers (Sorry for the late comment, due to a problem with my account.) – Alain Cochard Apr 7 '15 at 9:48

This kind of problem happens very frequently with the french option of babel: it makes some ponctuation characters (; : ? !) active in order to insert proper spacing before them, following the rules of French typography. But then it triggers some bugs with other packages, the most notorious being tikz-pgf, and apparently refcheck too.

As a workaround, Daniel Flipo, maintainer of the frenchb module for babel, proposes to enclose the command \NoAutoSpacing into TeX groups containing the problematic parts, as such:

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[french]{babel} % french now preferable to francais or frenchb, D. Flipo tells us
\usepackage{refcheck}

\begin{document}
$$\NoAutoSpacing \label{eq:xx} x=3$$
On identifie {\NoAutoSpacing\ref{eq:xx}}.

\end{document}


Of course, this is a general solution and in that precise case it is better to avoid the : in label names, as egreg and Bernard suggest! :-)

See the frenchb module documentation for more information.