Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question led to a new feature in a package:
impnattypo

French typography recommends that chapters be numbered in uppercase roman numbers, except for chapter 1 which should be called "Chapitre premier", so it should be:

  • Chapitre premier
  • Chapitre II
  • Chapitre III
  • etc.

Trying to implement that, I've come up so far with:

\usepackage{ifthen}                                                             
\renewcommand{\thechapter}{%                                                    
  \ifthenelse{\value{chapter}=1}{premier}{\Roman{chapter}}                      
}                     

However, when compiling with this, I get:

! Use of \@chapter doesn't match its definition.
\new@ifnextchar ...served@d = #1\def \reserved@a {
                                                  #2}\def \reserved@b {#3}\f...
l.1 \chapter{\`A la recherche de la r\'eponse}

Where is the problem?

share|improve this question
1  
This chapter numbering messes up the table of contents big time! –  doncherry Jul 19 '11 at 21:58
    
Right. I've checked a few books though, and it is indeed in use. –  ℝaphink Jul 20 '11 at 5:16
1  
Note that French typography recommends to put the ToC at the end of the book (that's right, even after the index actually), so hardly anyone gets to see it anyway. –  ℝaphink Jul 20 '11 at 5:40
    
My solution would be "Don't use such a crazy typesetting convention"! Those crazy French... –  Seamus Jul 20 '11 at 10:30
2  
@Raphink any people who speak a language that insists "ninety" should be said "four-twenty-ten" should probably not be trusted to come up with sane typographical conventions... –  Seamus Jul 20 '11 at 10:35
show 1 more comment

2 Answers

up vote 10 down vote accepted

Here's a solution using \ifnum, without ifthen:

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\renewcommand{\thechapter}{%                                                    
  \ifnum\value{chapter}=1
    premier%
  \else
    \Roman{chapter}%
  \fi
} 
\begin{document}
\chapter{One}
\chapter{Two}
\end{document}
share|improve this answer
    
Thank you. Is there a way do to it without affecting the ToC, so that only the chapter headings is modified, but the arabic number is still used elsewhere? –  ℝaphink Jul 20 '11 at 5:49
1  
@Raphink: in that case don't redefine \thechapter, customize the chapter headings instead, for example using the titlesec package. –  Stefan Kottwitz Jul 20 '11 at 6:58
1  
If I were to do a CTAN package to make it easier for all thriving French TeXnicians, which solution would you recommend? –  ℝaphink Jul 20 '11 at 7:21
1  
@Raphink: Some classes implement chapter headings differently, so it might be hard to produce a general headings-only solution. You could redefine \@makechapterhead though it's not guaranteed that classes other than the base classes use it. –  Stefan Kottwitz Jul 20 '11 at 8:03
add comment

I guess that ifthen somehow fails at proper expansion. Use etoolbox instead.

\documentclass{book}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{blindtext}

\usepackage{etoolbox}                                                          
\renewcommand{\thechapter}{%                                            
  \ifnumequal{\value{chapter}}{1}{premier}{\Roman{chapter}}%
}

\begin{document}

\chapter{foo}

\blindtext

\chapter{bar}

\blindtext

\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.