french
has done changing things over the years for a long time (I don't know since when) a specific deal with \partname
. Jump to bottom of answer for the brief version. This is in fact a long-standing problem... (which I bump into again every few years).
Thus you need to communicate version numbers (check the log). Perhaps option PartNameFull=false
will help in your case if you use latest not too old version of french
. You can find its documentation in French at this location. Check particularly pages 13 and 14 of this French language documentation.
[I know my answer is presumably not what is at stake here, I will delete this once the actual question is clarified]
Incomplete explanation
In fact I had encountered similar issue in the past. The toc file will contain
\contentsline {part}{\partnumberline {I}Name of the part 1}{3}
Then the expansion of \l@part
at some point invokes (using up-to-date TL2017 as of today 2017/09/23)
\FB@partname ->\ifFBPartNameFull \csname ordinal\romannumeral \value {part}\endcsname \space \frenchpartnameord \FB@emptypart \else Partie\fi
But at this stage when the TOC is typeset, the part counter is at zero. Hence we end up with \ordinal
which fetches \space
as argument. But french.ldf
only defines \ordinali
, \ordinalii
, etc... macros:
\SetStringLoop{ordinal#1}{%
\frenchpartfirst,\frenchpartsecond,Troisième,Quatrième,%
Cinquième,Sixième,Septième,Huitième,Neuvième,Dixième,Onzième,%
Douzième,Treizième,Quatorzième,Quinzième,Seizième,%
Dix-septième,Dix-huitième,Dix-neuvième,Vingtième}
and never defines \ordinal
. The \ordinal
macro is provided by memoir
class.
$ latexdef -c memoir ordinal
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\\\@protected\@testopt { <-- HERE ?\\.*? }? *(\\\\.*?) / at /usr/local/bin/latexdef line 391.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/^\\\@testopt { <-- HERE ?(\\.*?) }?/ at /usr/local/bin/latexdef line 394.
\ordinal:
macro:#1->\begingroup \let \fnumbersep \relax \form@tnumber {#1}\let \ordstring \nthstring \ifnum \c@xsm@mctr =\@ne \else \ifcase \c@ism@mctr \or \let \ordstring \iststring \or \let \ordstring \iindstring \or \let \ordstring \iiirdstring \fi \fi \ordscript {\ordstring }\endgroup
and it ends up in an error with #1
being \space
.
(please someone, tell me how to get rid of the annoying warnings from usage of latexdef
...)
I am sure I met this earlier, but I forget the details.
Using
\frenchsetup{PartNameFull=false}
is workaround because it avoids the bad branch in
\FB@partname ->\ifFBPartNameFull \csname ordinal\romannumeral \value {part}\endcsname \space \frenchpartnameord \FB@emptypart \else Partie\fi
Alternative is to do \setcounter{part}{1}
before the TOC, but this is just proof of concept because result is of course bad.
The gist of it, in short
The \tableofcontents
executes \l@part
and the latter will expand under memoir class the \cftpartname
.
If you modify \cftpartname
to use the babel \partname
, then with French babel module, this will, by default try to expand to something which depends upon the current value of the part counter.
But, typically, the \tableofcontents
is before the first \part
, thus the part
counter has value zero. The french.ldf
code does not foresee that part
could be zero, and ultimately an error is raised due to the fact that the memoir \ordinal
macro is expanded with a wrong argument.
In essence, french.ldf
by default makes usage of \partname
in the TOC resulting into at best non-sense, and at worst a TeX error at some stage. It restricts its use to the sectioning units themselves only.
(so what goes in the .toc
file is already expanded and ok; the problem is if the .toc
file itself attempts to use on its own \partname
)
\renewcommand*{\cftpartname}{\partname~}
works for me\usepackage[english,francais]{babel}
, I have an error. Any idea?memoir
give a chance in order to detect the language forbabel
: Try\documentclass[french]{memoir} \usepackage[T1]{fontenc} \usepackage[english]{babel}
[french]
tomemoir
package does not work, I still have an error if I select French as language in babel..aux
file in between?