0

I'm working in sharelatex and a requirement for my thesis is a summary in the ToC which is an unnumbered chapter and without page number. Now, I fixed the numberless chapter, but there is no documentation of latex of excluding the page number for a single chapter in the ToC. Is this possible?

2

2 Answers 2

2

To avoid the page number in the ToC you can add the ToC entry manually with \addtocontents:

\documentclass{book}
\newcommand\fakechapter[2][]{%
  \ifx&#1&%
    \fakechapter[#2]{#2}%
  \else
    \chapter*{#2}%
    \chaptermark{#1}%
    \addtocontents{toc}{\protect\contentsline{chapter}{#1}{}}%
  \fi
}
\begin{document}
\tableofcontents
\fakechapter{Abc}
\chapter{Def}
\fakechapter[Something]{Ghi}
\end{document}

enter image description here

1
  • I discovered that\contentsline used as above will result in trouble when used with hyperref (tex.stackexchange.com/questions/589153/…). \contentsline takes four arguments and hyperref will abort the build if they're not all there.
    – Frotz
    Commented Mar 29, 2021 at 0:48
1

If you are using the memoir class (which caters for the book, report, and article classes) you can do this:

\documentclass[...]{memoir}
\begin{document}
\frontmatter
\tableofcontents*
\mainmatter
\chapter*{Summary} % No ToC entry
\addtocontents{toc}{\cftpagenumbersoff{chapter}} % no chapter page numbers
\addcontentsline{toc}{chapter}{Summary} % put Summary chapter title in ToC
\addtocontents{toc}{\cftpagenumberson{chapter}} % chapter page numbers printed - edited brackets    
Summary of the thesis.
\chapter{One}
Your thesis ...
\end{document}

You must log in to answer this question.

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