Theses, Books, Title pagesHow do I add a preface section prior to the table of content

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Post Reply
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

How do I add a preface section prior to the table of content

Post by templateuser »

Hi,

how can I add a Preface before the Contents in this style? Although the template is very beautiful I miss the possibility of adding some important pages before the actual matter of the book starts. It would be great if you could show a short example. Many thanks.

Lorenzo

Recommended reading 2024:

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

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

User avatar
Vel
Site Moderator
Posts: 463
Joined: Fri Jun 29, 2012 1:20 am

How do I add a preface section prior to the table of content

Post by Vel »

Hi Lorenzo,

All you have to do is include a chapter before the table of contents section is start it in the same way as Chapter 1 but before where the table of contents appears in the document. For example:

Code: Select all

\chapterimage{chapter_head_2.pdf}
\chapter{Preface}
\section{Paragraphs of Text}\index{Paragraphs of Text}
\lipsum[1-7]
\cleardoublepage
\chapterimage{chapter_head_1.pdf}
\pagestyle{empty}
\tableofcontents
\cleardoublepage
\pagestyle{fancy}
Cheers,
Vel
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

How do I add a preface section prior to the table of content

Post by templateuser »

Hi Vel,

many thanks for your reply. Unfortunately I have tried your suggestion and it game me an error when executing pdflatex main:

Code: Select all

! LaTeX Error: Something’s wrong–perhaps a missing \item.

See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
…

l.149 \chapter{Introduction}

?
! Emergency stop.
…

l.149 \chapter{Introduction}

! ==> Fatal error occurred, no output PDF file produced!
Transcript written on main.log.

Chapter Introduction is the first chapter I have immediately after the table of contents.

Of course, before adding the lines you suggested the file compiled without errors and a very nice PDF was produced.

I tried the simplest modification possible as well, that is, just adding the line

\chapter{Preface}

just before the comments:

%—————————————————————————————-
% TABLE OF CONTENTS
%—————————————————————————————-


but even this simple modification produced the error reported above.

Thanks once again,
Lorenzo
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

How do I add a preface section prior to the table of content

Post by templateuser »

Solved! The command \chapter just needed an asterisk to suppress the chapter number. Therefore, the command should be written as:

\chapter*{Preface}

Is it possible to make appear the Preface listed in the Table of Contents and to assign lowercase roman numbers to the pages before the Table of Contents itself?

Thanks
Lorenzo
User avatar
Vel
Site Moderator
Posts: 463
Joined: Fri Jun 29, 2012 1:20 am

How do I add a preface section prior to the table of content

Post by Vel »

Hey Lorenzo,

I had that error come up too (“LaTeX Error: Something’s wrong–perhaps a missing \item.“), but if I skip it when it first comes up it doesn’t come up again.

Regarding roman numbers prior to the table of contents, have a look at the Masters/Doctoral Thesis template for an example of how to do that.

Cheers,
Vel
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com
Post Reply