I'm using the report
document class for a thesis, and I need to add things like "Acknowledgements" and an "Introduction". I noticed that there is an \abstract
command which would have been wonderful if applied similarly. How do I add these without messing up the chapters' numbering while being picked up by the ToC in proper order and page numbering?
3 Answers
To get unnumbered chapters, parts, sections, subsections, etc, you just affix a *
(asterisk) to the respective sectioning command; hence, you'd type something like
\section*{Acknowledgments}
or
\chapter*{Introduction}
Exactly which sectioning command you ought to use will depend importantly on aspects of the document that you haven't told us about. E.g., should the respective parts begin on a page of their own, and how prominent do you want the caption of the sectioning command to be?
Note that unnumbered parts, chapters, sections, etc are not included automatically in the table of contents (ToC). In case you need some (or all) of them to be included, you should insert an \addcontentsline
instruction after each such sectioning command. For example, you'd type:
\chapter*{Foreword}
\addcontentsline{toc}{chapter}{Foreword}
The second argument of the \addcontentsline
instruction -- here, chapter
-- instructs LaTeX to typeset the entry in a given style, here, "chapter style".
The following MWE
\documentclass{report}
\begin{document}
\tableofcontents
\chapter*{Acknowledgments}
\addcontentsline{toc}{chapter}{Acknowledgments}
\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}
\chapter{Experiments}
\chapter{Conclusion}
\end{document}
generates this ToC:
-
2That's wrong. :) A
\chapter
command in the\frontmatter
produces by itself an unnumbered chapter which goes in the ToC. The OP uses report, it seems, so no\frontmatter
and\mainmatter
.– egregNov 19, 2011 at 23:46 -
I had missed the fact that the OP was using the
report
rather than thebook
document class. I've updated my MWE.– MicoNov 20, 2011 at 0:00 -
If the
book
class is really better, I suppose I should give it a try, but I would need the support for such an endeavour, probably post a new thread to see if it is more fitting for a thesis. I really don't have time to experiment, I couldn't even check my own post (this one) for 2 days. Nov 22, 2011 at 0:38 -
1in
\addcontentsline{toc}{chapter}{Acknowledgments}
what does{toc}
do?– snoramSep 10, 2016 at 19:20 -
4@snoram - The option
toc
tells LaTeX to write the output to\jobname.toc
, where\jobname
is set to the name of your main tex file. Other options arelot
(to write to\jobname.lot
, for the "List of Tables", generated by\listoftables
) andlof
(to write to\jobname.lof
, for the "List of Figures", generated by\listoffigures
. (Note, though, that the sample document features a\tableofcontents
instruction but no\listoftables
or\listoffigures
instructions.)– MicoSep 10, 2016 at 19:41
Besides adding unnumbered chapters/sections to the ToC, you may also want to ensure that they are correctly displayed in the header/footer. In the report
and book
class this may be done by writing, e.g.,
\chapter*{Introduction}
\markboth{Introduction}{Introduction}
for unnumbered chapters (the second argument of \markboth
controls "right" [odd] pages in twoside
documents; it may also be left empty) and
\section*{Introduction}
\markright{Introduction}
for unnumbered sections. (Should you have enabled headers in the article
class, use \markboth
in conjunction with \section*
and \markright
in conjunction with \subsection*
.)
Note that the above code snippets will produce non-capitalized names in the header; should you want to capitalize them (as for numbered chapters in the standard classes), replace Introduction
with \MakeUppercase{Introduction}
.
Addendum: Both Mico's and my answer refer to the standard document classes (article
, book
, report
). The answers should work for most other classes; however, some classes may offer easier solutions. E.g., with the KOMA-Script
classes you may simply use the commands \addchap
/\addsec
to create unnumbered chapters/sections that will be displayed in the ToC and the header.
-
wow - literally took a couple dozen answer-trials till i found this one. amazing - thanks! Aug 25, 2019 at 15:09
A little package on github that might never hit CTAN can be of help here.
It takes care of the entries and the headings automatically.
\documentclass{book}
\usepackage{blindtext}
\usepackage[
% indentunnumbered
]{unnumberedtotoc} %get it from https://github.com/johannesbottcher/unnumberedtotoc
\usepackage{hyperref}
\begin{document}
\tableofcontents
\addchap{unnumbered chapter with toc and head}
\blindtext[10]
\addchap[title for toc and head]{chapter title}
\blindtext[10]
\addsec*{starred addsec}
\blindtext[10]
\addsec{regular addsec}
\blindtext[10]
\addsec*{starred addsec}
\blindtext[10]
\chapter{usual chapter}
\blindtext[10]
\chapter*{look at the header}
\blindtext[10]
\addchap*{really nothing, header cleared}
\blindtext[10]
\end{document}
\chapter*{Acknowledgements}
and\chapter*{Introduction}
. These chapter will be formatted similarly to\chapter
, without the number and not show up in the ToC. Subsequent chapters will be numbered1
,2
, ... Is this what you're after? Or are you interested in have something look similar to\abstract
from thearticle
document class? Note that thereport
document class does not provide\abstract
, only anabstract
environment.book
class over thereport
class. That way you get the handy\frontmatter
,\mainmatter
and\backmatter
switches that handle this for you. Otherwise it's not a lot different fromreport
.