GeneralFormatting for ToC Entries of multiple Appendices

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
malikimran
Posts: 3
Joined: Thu Aug 22, 2013 10:42 am

Formatting for ToC Entries of multiple Appendices

Post by malikimran »

Hi all,

I am writing my thesis using the book class. I have three appendices A,B and C. In the ToC these appendices appear like this

Code: Select all

Appendices A – C             107-120
But I want in this format.

Code: Select all

Appendix A                       107
Appendix B                       115
Appendix C                       120
Please help me how can I achieve the desired one. I use the following code for this.

Code: Select all

\renewcommand{\appendix}{%
  \@appendixtrue
  \settocdepth{chapter}
  \pagebreak%  force a page break, so that TOC will show a correct page number
  \settocdepth{chapter}
  \setcounter{chapter}{0}%
  \setcounter{section}{0}%
  %\setcounter{tocdepth}{0}
  \gdef\@chapapp{\MakeUppercase{\appendixname}}%
  \gdef\thechapter{\@Alph\c@chapter}
  \phantomsection
  \label{apppg1}
  %  add to TOC
  %\phantomsection
  %\addtocontents{toc}{\protect\addvspace{\@twolinespacing}}
  %\addcontentsline{toc}{nonmainmatterchapter}{\appendicesname}
  %added
  %\addtocontents{toc}{\protect\addvspace{\@twolinespacing}}
  \addtocontents{toc}{\protect\vspace{\@twolinespacing}}
  %\addtocontents{toc}{\protect\noindent\MakeUppercase{\bf\appendicesname}}
  %\addtocontents{toc}{\protect\addvspace{\@twolinespacing}}%
}
Last edited by localghost on Tue Nov 19, 2013 11:18 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Formatting for ToC Entries of multiple Appendices

Post by localghost »

Forget that code and try the appendix package.


Thorsten
Post Reply