3

I have a chapter (??) which is intended to be printed on the inside back cover of a booklet I am producing. I want it listed in the table of contents, but with a pointer to 'insider back cover' in the ToC, not a page number. Is this possible? If so, how?

I have been trying code which looks like this:

\addtocontents{toc}{\contentsline{chapter}{\numberline{}{Mission of our organization}{inside back cover}}}

but keep getting compilation errors which read like so:

) [60] (./backmatter/01_mission.tex
! Argument of \contentsline has an extra }.
<inserted text> 
                \par 
l.4 ...our organization}{inside back cover}}}

? q

Any guidance is appreciated. Thanks.

Hugh Esco
  • 43
  • 4
  • I just tried this: \setcounter{page}{inside back cover}

    but got this error message on compilation: ` [60] (./backmatter/01_mission.tex ! Missing number, treated as zero.

    i l.2 \setcounter{page}{inside back cover}`
    – Hugh Esco Dec 07 '21 at 05:42
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Dec 07 '21 at 05:45
  • If you are actually printing the last page, just use \def\thepage{} or possibly \def\thepage{Cover} anywhere on the last page. \pagestyle{empty} might help. – John Kormylo Dec 07 '21 at 15:53

1 Answers1

5

Two things:

  1. You need to \protect content that you don't want expanded, since writing to the .toc will do that.

  2. \contentsline takes four arguments.

enter image description here

\documentclass{book}

\begin{document}

\tableofcontents

\chapter{A chapter}

\addtocontents{toc}{% \protect\contentsline{chapter}{\protect\numberline{}Mission of our organisation}{inside back cover}{}}

\end{document}

Werner
  • 603,163