169

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?

7
  • 2
    For unnumbered chapters, you could just use \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 numbered 1, 2, ... Is this what you're after? Or are you interested in have something look similar to \abstract from the article document class? Note that the report document class does not provide \abstract, only an abstract environment.
    – Werner
    Nov 19, 2011 at 23:02
  • I know that this seems like a potentially big shift, but I recommend the book class over the report class. That way you get the handy \frontmatter, \mainmatter and \backmatter switches that handle this for you. Otherwise it's not a lot different from report.
    – qubyte
    Nov 20, 2011 at 4:33
  • @Werner: I appologize; I meant the abstract environment indeed. Yes it would be nice to have something like that for introductions and acknowledgements. Nov 22, 2011 at 0:17
  • @MarkS.Everitt: Well that depends on how different it is. My problem is that I didn't get to experiment much with tex/latex since I've learned about it 3 or 4 months ago and I'm way behind schedule with my thesis, I'd love to learn a new style and how to deal with it, It's just that I might not have the time. Nov 22, 2011 at 0:22
  • @JosephWright: Actually now that I've checked my tex file, I actually use \documentclass not \documentstyle. Nov 22, 2011 at 0:27

3 Answers 3

210

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:

enter image description here

4
  • 1
    in \addcontentsline{toc}{chapter}{Acknowledgments} what does {toc} do?
    – snoram
    Sep 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 are lot (to write to \jobname.lot, for the "List of Tables", generated by \listoftables) and lof (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.)
    – Mico
    Sep 10, 2016 at 19:41
  • Many thanks to whoever provided the 100th upvote, earlier today! It yielded the 6th "Great Answer" gold badge. Thanks so much. This site is really great!!!
    – Mico
    Feb 10, 2018 at 20:49
  • You might also want to add a \mtcaddchapter in front of list of tables or figures if you're using one in case minitoc content does not appear. tex.stackexchange.com/questions/146461/minitoc-not-appear
    – usersina
    Jun 10, 2022 at 15:26
49

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.

1
  • 1
    wow - literally took a couple dozen answer-trials till i found this one. amazing - thanks!
    – trdavidson
    Aug 25, 2019 at 15:09
4

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}
2
  • 1
    Any reason why you haven't contributed this to CTAN? Mar 28, 2018 at 20:08
  • @ChrisCharabaruk Because it is not ready yet.
    – Johannes_B
    Mar 30, 2018 at 6:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .