0

I have a problem removing the page numbering in the ToC but not on the page. I´ve looked around for answers and tried several things but nothing works. I have to use \thispagestyle{plain} for numbering of the pages but this automatically puts the page in ToC. If I use {empty} instead, then I remove the page numbers on the page ...

Please help!

newpage
\thispagestyle{plain}
\setcounter{page}{1}
%\pagenumbering{gobble} (this supresses the page numbers on the page which is not what I want)

\addcontentsline{toc}{chapter}{Appendices}
\chapter*{Appendix 1: Room Temperature}

\noindent\makebox[\textwidth][c]{\raisebox{-0.9\height}[10pt][10pt]{\includegraphics[page=1,scale=0.6]{Room-Code}}}\par

\addcontentsline{toc}{chapter}{Appendix 1: Room Temperature}

So this is the ToC and everything is as it should be except that no number should be displayed next to the appendices

  • I'm not sure I understand: you want the page to be numbered, but the list of entries in the ToC should not have the page numbers? So just a list of chapter/section titles? – campa Aug 15 '19 at 13:01
  • @campa I have chapters in my text which numbers are displayed in the ToC. However, the appendixes should not have their numbers displayed in ToC but should have numbers in the pages. That's how my school wants it – Delfinium Aug 15 '19 at 13:07
  • 2
    Sorry, but you have not submitted any code we can work with. We need something self contained (and minimal) that we can just copy and test as is. Here there is no document class, no preamble, an image we do not have (probably irrelevant anyway) – daleif Aug 15 '19 at 13:12
  • Possible dublicate of this. – Niklas Aug 15 '19 at 13:43
  • @Niklas his example suppresses the numbers in the ToC however, it also removes the numbers on the pages in the appendices – Delfinium Aug 15 '19 at 13:50
1

Without an MWE in the question (document class, TOC related packages etc) it can be only a guess.

You could use package tocloft and add \cftpagenumbersoff{chapter} to the TOC.

Example:

\documentclass{report}
\usepackage{blindtext}% only for dummy text

\usepackage{tocloft}

\begin{document}
\tableofcontents
\blinddocument

\cleardoublepage
\setcounter{page}{1}
\addtocontents{toc}{\protect\cftpagenumbersoff{chapter}}% <- added
\addcontentsline{toc}{chapter}{Appendices}
\chapter*{Appendix 1: Room Temperature}
\addcontentsline{toc}{chapter}{Appendix 1: Room Temperature}

\blindtext
\end{document}

enter image description here

Or suggestion with package tocbasic:

\documentclass{report}
\usepackage{blindtext}% only for dummy text

\usepackage{tocbasic}
\newcommand\gobble[1]{}

\begin{document}
\tableofcontents
\blinddocument

\cleardoublepage
\setcounter{page}{1}
\addtocontents{toc}{\DeclareTOCStyleEntry[pagenumberformat=\protect\gobble]{tocline}{chapter}}
\addcontentsline{toc}{chapter}{Appendices}

\chapter*{Appendix 1: Room Temperature}
\addcontentsline{toc}{chapter}{Appendix 1: Room Temperature}

\blindtext
\end{document}

enter image description here

Or with \appendix:

\documentclass{report}
\usepackage{blindtext}% only for dummy text

\usepackage{tocbasic}
\newcommand\gobble[1]{}
\newcommand\appendixprefixintoc[1]{\appendixname~#1:\hfill}

\begin{document}
\tableofcontents
\blinddocument

\cleardoublepage
\appendix
\setcounter{page}{1}
\addtocontents{toc}{\DeclareTOCStyleEntry[pagenumberformat=\protect\gobble]{tocline}{chapter}}
\addcontentsline{toc}{chapter}{Appendices}
\addtocontents{toc}{\DeclareTOCStyleEntry[entrynumberformat=\protect\appendixprefixintoc,dynnumwidth]{tocline}{chapter}}
\chapter{Room Temperature}
\blindtext
\end{document}

enter image description here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.