# How to change the chapter number to display as text (One, Two, …)?

In LaTeX, how do I change the chapter number to display as text? eg:

CHAPTER ONE not CHAPTER 1;

CHAPTER THIRTEEN not CHAPTER 13.

-

## migrated from stackoverflow.comSep 26 '11 at 16:03

This question came from our site for professional and enthusiast programmers.

Related question: Convert any number to corresponding word – diabonas Sep 26 '11 at 16:15
Welcome to TeX.sx! Your question was migrated here from StackOverflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. – Werner Sep 26 '11 at 19:49

Short answer: put the following code before \begin{document}.

\usepackage{fmtcount,etoolbox}
\makeatletter
\patchcmd{\chaptermark}{\thechapter}{\NUMBERstring{chapter}}{}{}
\makeatother


Change \Numberstring into \numberstring if you don't want the number name capitalized.

A quick solution would be also

\usepackage{fmtcount}
\renewcommand{\thechapter}{\Numberstring{chapter}}


but this will have some consequences on the typesetting of the Table of Contents (but also of headers). Choosing a strategy depends on the actual needs (and also on the class used).

-
If you have more than 100,000 chapters, this will break. This isn't a huge problem, I don't think. But it is a limitation in fmtcount. – Seamus Nov 3 '11 at 8:47
Quite a big book it would be. :) Also my package for spelling out numbers in Italian (fmtcount's support for Italian is very buggy) has a limitation to 9999 for cardinal numbers and to 999 for ordinals. But one can survive it, I believe. – egreg Nov 3 '11 at 14:10
@egreg : How can I use your short answer (not the quick solution) with parts instead of chapters? – ClintEastwood Jun 12 '13 at 20:28
@ClintEastwood For parts I would go with redefining \thepart – egreg Jun 12 '13 at 20:32
Support of 99,999 chapters is more than enough, after all, some novels are only about 30,000 words. Even if every word were in a chapter to itself, it wouldn't break – user12711 Feb 12 at 19:41

The memoir documentclass provides this by default for some of the chapter styles. Consider reading the documentation; specifically section 6.5.1. Deﬁning a chapter style (p 83).

Alternatively, also view some of the self-created code on Vincent Zoonekynd's LaTeX page for Chapters.

-
The numname package takes the code from the memoir class and makes it available separately. The documentation is non-existent, but see this answer for details. – Seamus Nov 3 '11 at 8:49

You can also try fncychap package.

-

I have seen there are other, perhaps smarter answers. BUt I spent quite some time on making this work, so I really wanted to post it. THis allows to convert any number from digits to English words, provided it has absolute value strictly less than a billion. This means it is more powerful than fmtcount, which, AFAIK, allows no negative numbers, and stops at 99.999. So here goes:

\documentclass[a4paper]{report}
\usepackage{enumitem}

\newcommand{\encount}[1]{%
\ifnum #1>999999999%
\errmessage{Too high number.}%
\errhelp{The number you gave is at least a billion. I cannot count that high. Not in English, at least. Only in digits.}%
\else
\ifnum#1<0%
\count9=#1%
\multiply\count9 by -1%
minus \poscount{\count9}%
\else%
\poscount{#1}%
\fi%
\fi}
\newcommand{\unitcount}[1]{%
\ifcase#1zero\or one\or two\or three\or four\or five\or six\or seven\or eight\or nine\else\errmessage{WTF??}\fi%
}
\newcommand{\underhundredcount}[1]{%
\ifcase#1zero\or one\or two\or three\or four\or five\or six\or seven\or eight\or nine\or ten\or eleven\or twelve\or thirteen\or fourteen\or fifteen\or sixteen\or seventeen\or eighteen\or nineteen\or twenty\or twenty-one\or twenty-two\or twenty-three\or twenty-four\or twenty-five\or twenty-six\or twenty-seven\or twenty-eight\or twenty-nine\or thirty\or thirty-one\or thirty-two\or thirty-three\or thirty-four\or thirty-five\or thirty-six\or thirty-seven\or thirty-eight\or thirty-nine\or fourty\or fourty-one\or fourty-two\or fourty-three\or fourty-four\or fourty-five\or fourty-six\or fourty-seven\or fourty-eight\or fourty-nine\or fifty\or fifty-one\or fifty-two\or fifty-three\or fifty-four\or fifty-five\or fifty-six\or fifty-seven\or fifty-eight\or fifty-nine\or sixty\or sixty-one\or sixty-two\or sixty-three\or sixty-four\or sixty-five\or sixty-six\or sixty-seven\or sixty-eight\or sixty-nine\or seventy\or seventy-one\or seventy-two\or seventy-three\or seventy-four\or seventy-five\or seventy-six\or seventy-seven\or seventy-eight\or seventy-nine\or eighty\or eighty-one\or eighty-two\or eighty-three\or eighty-four\or eighty-five\or eighty-six\or eighty-seven\or eighty-eight\or eighty-nine\or ninety\or ninety-one\or ninety-two\or ninety-three\or ninety-four\or ninety-five\or ninety-six\or ninety-seven\or ninety-eight\or ninety-nine \else\errmessage{WTF??}\fi%
}
\newcommand{\underthousandcount}[1]{%
\count1=#1%
\ifnum#1>99%
\count7=#1%
\divide\count1 by 100%
\divide\count1 by 1%
\unitcount{\count1} hundred%
\multiply\count1 by 100%
\ifnum\count7>0%
\ and \underhundredcount{\count7}%
\fi%
\else%
\underhundredcount{#1}
\fi
}
\newcommand{\poscount}[1]{%
\count3=#1%
\count5=\count3%
\ifnum\count3<1000%
\underthousandcount{\count3}%
\else%
\ifnum\count3<1000000%
\divide\count3 by 1000%
\divide\count3 by 1%
\underthousandcount{\count3} thousand%
\multiply\count3 by 1000%
\count3=\count5%
\ifnum\count5>0%
\ifnum\count5>99,\else\ and\fi\ \underthousandcount{\count3}%
\fi
\else
\divide\count3 by 1000000%
\divide\count3 by 1%
\underthousandcount{\count3} million%
\multiply\count3 by 1000000%
\ifnum\count5>0%
\count3=\count5%
\divide\count3 by 1000\relax%
\ifnum\count5>99, \else\ and \fi%
\ifnum\count3>0%
\underthousandcount{\count3} thousand%
\fi%
\count5=#1%
\count3=\count5%
\divide\count3 by 1000%
\multiply\count3 by 1000%
\ifnum\count5>0%
\underthousandcount{\count5}%
\fi%
\fi%
\fi%
\fi
}
\makeatletter
\renewcommand{\thesection}{\encount{\c@section}}
\newcommand{\test}[2]{
\begin{enumerate}
\setcounter{enumi}{#1}\loop\ifnum\c@enumi<#2\item\encount{\the\c@enumi}\repeat
\end{enumerate}
}
\makeatother

\begin{document}
\encount{123456789}
\test{999999}{1001000}
\end{document}


This provides a compilable example, which shows numbers from one million to one million, one thousand, printed as a numbered list. After typesetting one hundred and twenty-three million, four hundred and fifty-six thousand, seven hundred and eighty-nine on a line by itself. The important macros are \encount, \unitcount, \underhundredcount, \underthousandcount and \poscount. Only the first one is to be used. The others are internals. Yes, I should use different names with @ to avoid accidental redefinition, and yes, I should use even-numbered counter registers, but hey, I have no time for such small adjustments :). The code can easily be adjusted for uppercase. Giving an option for first letter capitalization is quite tricky, and requires to create a conditional just for that. To use this for chapter numbering, the following line added to the preamble should work

\renewcommand\thechapter{\encount{\c@chapter}}


Of course, it must be wrapped in \makeatletter…\makeatother. I haven't tested it, but it should work. Goodnight everyone and enjoy my macro :).

-

As a LaTeX user who understands the basic concepts: the scripting structure, packages, classes and distribution options, but gets blown away by the complexity of nested macros to try to do accomplish something profoundly simply, I'm going to try a practical solution that might just be the easiest of them all.

TRY THIS: I've got a novel writing project, and currently plan to use \chapter to hold the title, for example, "Escape from Daldran" and then I'm going to immediately follow the first chapter with a \section that I'll title "CHAPTER ONE," the second \chapter will follow with a \section titled "CHAPTER TWO" etc.

I'll use the fancyhdr package to put page numbers on the bottom of regular pages. For the headers will use smallcaps only.

THIS IS HOW IT WORKS: on even pages I'll use the SECTION TITLE (which I loaded with the chapter number) for instance "CHAPTER TWELVE" and on odd pages will use the Chapter Title, for example "THE DESERTED FORTRESS"

Numberals look too technical for literary fiction, but great for a textbook and most nonfiction. So LaTeX is the way to go, but for Literary works, (Novels and literary Non-Fiction) I really wish some packages would have extra options built in to automatically use "words" rather than "numbers" In a truly literary work, you don't want any numerals or vector graphics, just fonts. Even asterisks for lines. That's literary!

Unless you programmatically deal with LaTeX, or take a deep breath and use some uncommon solutions that'd irk your physics professor, everything it spits out looks like it's written for a textbook publication, or an academician to read.

The Literary Community need some extra package options for LaTeX, like fancyhdr, to have a few simple literary options added. Then, LaTeX would really explode into usage by CreateSpace and Lulu self publishers. But, perhaps the LaTeX community doesn't want to rock any business boats, and stick with being a useful tool academia only. So, if you know a LaTeX programmer-contributor, please ask them to add a few options to some common packages for us, please.

-
This does not constitute an answer to the question. – Werner Feb 12 at 20:48
QUESTION "How to change the chapter number to display as text (One, Two, …)?" ANSWER: type "One" or "Two" etc as a \section title, immediately following \chapter. It works perfectly for literary novel projects that aren't heavily enumerated. – user12711 Feb 12 at 21:24