GeneralQuestions about TOC

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
plainheart
Posts: 2
Joined: Wed Jul 23, 2008 1:47 am

Questions about TOC

Post by plainheart »

Hi,

I used Latex for several years, but with the built template. I have no much experience about modifying template myself.
Now I have struggling almost a day to do the required modification. There are a few questions left. Two of them are
a. The table of contents look like
1 INTTRODUCTION
1.1
1.2
Now I want to add "CHAPTER" before the chapter number, so that the TOC look like
CHAPTER 1 INTRODUCTION
1.1
1.2
How can I do that?
b. I hope the name of the chapters appear in the center of the paper. The default setting is flushleft.

Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Questions about TOC

Post by Stefan Kottwitz »

Hi,

that can be solved by the tocloft package.
Have a look at this thread: Include the word chapter in table of contents.
gmedina provided a working example there.

Stefan
LaTeX.org admin
plainheart
Posts: 2
Joined: Wed Jul 23, 2008 1:47 am

Re: Questions about TOC

Post by plainheart »

Thanks. Then what about the 2nd question, then?
I need each chapter caption displayed in the center, but now its flushleft.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Questions about TOC

Post by Stefan Kottwitz »

This could be done by the titlesec package, for example:

Code: Select all

\documentclass[a4paper,10pt]{book}
\usepackage{titlesec}
\titleformat{\chapter}[display]{\centering\normalfont\huge\bfseries}
{\chaptertitlename\ \thechapter}{20pt}{\Huge}\begin{document}
\tableofcontents
\chapter{Introduction}
Text
\chapter{Test}
Text
\end{document}
Stefan
LaTeX.org admin
Post Reply