Text Formatting ⇒ Table of Content: add "Chapter" in ToC
Table of Content: add "Chapter" in ToC
Good day!
I have the following issue regarding the way Table of Content looks:
This is what the table of contents pages currently looks like:
Table of Contents
1 Introduction ....... Page #
1.1 Really Introducing ....... Page #
2 The Data ....... Page #
2.1 About the Data ....... Page #
But I wouldlike to have the following style:
Table of Contents
Chapter 1 Introduction ....... Page #
1.1 Really Introducing ....... Page #
Chapter 2 The Data ....... Page #
2.1 About the Data ....... Page #
That means I would like to have the word "Chapter" printed in front of the chapter index in the Table of Contents. By the way, the word "Chapter" should not appear in front of the indexes of the sections and the subsections.
Is this do-able? How can I achieve this?
Isix
I have the following issue regarding the way Table of Content looks:
This is what the table of contents pages currently looks like:
Table of Contents
1 Introduction ....... Page #
1.1 Really Introducing ....... Page #
2 The Data ....... Page #
2.1 About the Data ....... Page #
But I wouldlike to have the following style:
Table of Contents
Chapter 1 Introduction ....... Page #
1.1 Really Introducing ....... Page #
Chapter 2 The Data ....... Page #
2.1 About the Data ....... Page #
That means I would like to have the word "Chapter" printed in front of the chapter index in the Table of Contents. By the way, the word "Chapter" should not appear in front of the indexes of the sections and the subsections.
Is this do-able? How can I achieve this?
Isix
NEW: TikZ book now 40% off at Amazon.com for a short time.

Re: Table of Content: add "Chapter" in ToC
depends on your document class. The memoir class supports this out of the box by placing
\renewcommand\cftchaptername{\chaptername~}
in the preamble
If you are not able to use memoir, then tocloft may be able to do this, but it has been a while since I had a look at that package.
\renewcommand\cftchaptername{\chaptername~}
in the preamble
If you are not able to use memoir, then tocloft may be able to do this, but it has been a while since I had a look at that package.
Table of Content: add "Chapter" in ToC
how to make this looks like:daleif wrote:depends on your document class. The memoir class supports this out of the box by placing
\renewcommand\cftchaptername{\chaptername~}
in the preamble
If you are not able to use memoir, then tocloft may be able to do this, but it has been a while since I had a look at that package.
Chapter One: instead of Chapter 1?
Table of Content: add "Chapter" in ToC
In the ToC or in the text?
In the ToC you have have to do some hacking
note that this is not a general solution, as it does not take appendices into account (i.e. chapter numbering that are not numbers)
In the ToC you have have to do some hacking
Code: Select all
Code, edit and compile here:
\documentclass[a4paper]{memoir}\let\oldchapternumberline\chapternumberline\renewcommand\chapternumberline[1]{%\oldchapternumberline{\numtoName{#1}}}\renewcommand\cftchaptername{\chaptername~}\addtolength\cftchapternumwidth{1em}\begin{document}\tableofcontents*\chapter{test}\end{document}
Table of Content: add "Chapter" in ToC
Thanks. But how to make the chapter name directly follows the chapter number. For example, in my case, the ToC appears like this:daleif wrote:In the ToC or in the text?
In the ToC you have have to do some hacking
note that this is not a general solution, as it does not take appendices into account (i.e. chapter numbering that are not numbers)Code: Select all
Code, edit and compile here:\documentclass[a4paper]{memoir}\let\oldchapternumberline\chapternumberline\renewcommand\chapternumberline[1]{%\oldchapternumberline{\numtoName{#1}}}\renewcommand\cftchaptername{\chaptername~}\addtolength\cftchapternumwidth{1em}\begin{document}\tableofcontents*\chapter{test}\end{document}
Chapter One:....Name1
Chapter Two:....Name2
Chapter Three: Name3
The dots are used just to fill the spaces
I want this to look like this:
Chapter One: Name1
Chapter Two: Name2
Chapter Three: Name3
Thanks in dvance
Table of Content: add "Chapter" in ToC
Then you will have to change \chapternumberline
would be enough
Code: Select all
Code, edit and compile here:
\makeatletter\renewcommand\chapternumberline[1]{%\@chapapp@head\@cftbsnum \numtoName{#1}\@cftasnum~}\renewcommand\cftchaptername{\chaptername~}\makeatother
Table of Content: add "Chapter" in ToC
Ok, now it is working just fine.daleif wrote:Then you will have to change \chapternumberline
would be enoughCode: Select all
Code, edit and compile here:\makeatletter\renewcommand\chapternumberline[1]{%\@chapapp@head\@cftbsnum \numtoName{#1}\@cftasnum~}\renewcommand\cftchaptername{\chaptername~}\makeatother
Thank you very much.
Regards
Table of Content: add "Chapter" in ToC
daleif, according to your first reply I did:
Which results in the error message
Where am I going wrong? If I include the package tocloft (which I have) as in
then it gets worse, because now the errors would be about 25, refering to the file tocloft.sty.
Isix6
Code: Select all
Code, edit and compile here:
\documentclass[a4paper]{memoir}\renewcommand\cftchaptername{\chaptername~}\begin{document}\tableofcontents*\chapter{Intro}\section{History}\chapter{Theory}\section{The Equation}\chapter{Hypothesis}\section{Our Claim}\chapter{Analysis}\section{Tne Work}\chapter{Results}\section{Suprises}\chapter{Conclusion}\section{Next Stuff}\end{document}
Code: Select all
[LaTeX] test-toc-formating.tex => test-toc-formating.dvi (latex)[LaTeX] finished with exit status 1./test-toc-formating.tex:3:\cftchaptername undefined. \renewcommand\cftchaptername[LaTeX] 1 error, 0 warnings, 0 badboxes
Code: Select all
\usepackage{tocloft}
Isix6
Re: Table of Content: add "Chapter" in ToC
Which version of memoir are you using?
try adding \listfiles before \documentclass, and then look in the log file.
You seem to be using an old memoir
try adding \listfiles before \documentclass, and then look in the log file.
You seem to be using an old memoir
Table of Content: add "Chapter" in ToC
I get:
Could my memoir be old?
Code: Select all
*File List*memoir.cls 2004/04/05 v1.61 configurable document classmem10.clo 2002/07/27 v0.2 memoir class 10pt size optionmempatch.sty 2005/02/01 v3.5 Patches for memoir class v1.61***********