I ask another question related to this one "Literal" numbering of chapters but not in contents which was not "precise"... This question is the exact one, with an example...

This example gives me chapters "one" and "two" in the first pages of chapters (and this is what I want), and in the contents "1" and "two" (and this isn't what I want..). I want to obtain the same thing in the text but, in the contents, "1" and "2".. Then how to change the chapterhead, to be numeric.. I want it "1.1" for the section 1 not "one.1" like in my example.

I write all the packages for preventing eventual conflicts because I use all this packages in my book (of probability in arabic)...





    \newcommand\words[1]{\expandafter\xwords\csname c@#1\endcsname}
        I need more words\fi}

    \section{Introduction 1} 
    \section{Introduction 2} 

1 Answer 1


Instead of modifying the macro \thechapter that's used inside the macro \@makechapterhead, one could patch \@makechapterhead directly to make it use \words{chapter} instead of \thechapter when typesetting the representation of the chapter's "number". (The patching may be done via a \patchcmd instruction. As it looks like you're loading the etoolbox package anyway, you'll have access to \patchcmd.) By not touching the definition of \thechapter, no downstream complications result in terms of uses of \thechapter in, say, the creation of the table of contents.

Summarizing, I suggest that instead of


you execute

% \usepackage{etoolbox} %% uncomment if 'etoolbox' isn't already being loaded

Aside: In order to get your code to compile on my system (MacOSX 10.9.2, TeXLive2104/pre with all packages fully up to date), I had to comment out the instruction \usepackage{titletoc} that's in your preamble. It looks like titletoc tries to load the inputenc package, either directly or through a subsidiary package. When compiling a document under XeLaTeX -- which seems to be the case here, since you're also loading polyglossia -- the inputenc package should not be loaded. XeLaTeX (and LuaLaTeX too, for that matter) can handle only one input encoding system: UTF8. I think that until quite recently only a warning message would be issued if you (or one of the packages you specify) loaded inputenc; with the most recent update to TeXLive an outright error message is generated and compilation hangs. Let's all hope that the titletoc package gets upgraded soon to no longer load inputenc (and especially not if running under either XeLaTeX or LuaLaTeX).

  • Thanks Mico for your very pedagogic explanation about the problems related to what I want... I tried your command which works very well in "normal" packages, but which has not any effect with polyglossia... Any way, I regret this so much because the first page of chapters is so beautiful in arabic when it's litteral.. Let's hope that the new versions of titlesec will avoid inputenc, and all be fine... Thanks May 9, 2014 at 9:18
  • @FaouziBellalouna - I'm not sure I understand the issue. I am able to compile your MWE under XeLaTeX -- and with the polyglossia package loaded -- as long as the titletoc package is not loaded. Please elaborate what you mean by "does not have any effect". Which TeX distribution do you use, by the way?
    – Mico
    May 9, 2014 at 9:26
  • first I want to many thank you because your question made me to study the problem deeply and see what means "does not have any effect" and why !!?? So I saw all my macros and found the reason of that, what is this... \titleformat{\chapter}[display] {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge} \titlespacing{\chapter} {0pt}{40pt}{-10pt} I don't know why I use this, I think it's connected with minitableofcontents !!... So when I comment it, all is very well !! it writes me litteral numbering for chapter... الباب الأول... الباب الثاني... May 9, 2014 at 10:46
  • This is very more beautiful in arabic instead of ...الباب 1... الباب 2... The word الباب means "Chapter" in arabic.. So I tried for 3 or 4 chapters of my book and all seems well.. So I'm "perplexe".. what's the utility for me of what I've commented ?? why it have this effect (i.e the numbering is numeric not litteral ) ?? Many thanks another time May 9, 2014 at 10:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .