General ⇒ Get unnumbered Headings into the ToC
Get unnumbered Headings into the ToC
I am writing my thesis and I have what I call an electronic appendix with a lot of programming files, that I don't wish to include in the regular appendix in the report. I would however still like to add the name of the directories with the files to the table of contents, so the reader knows what he can find in the electronic appendix. So after all the regular TOC elements for the report have been listed, I would like some elements (which I name manually) to be listed in the TOC as well. For those elements no dots or page numbers should be seen, and elements should not be added to the PDF bookmarks.
Does anyone know how to do this?
// Jonathan
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
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Get unnumbered Headings into the ToC
you could use
\addtocontents
, such as
Code: Select all
\addtocontents{toc}{File name}
Get unnumbered Headings into the ToC
Code: Select all
\addtocontents{toc}{\bigskip \textbf{Electronic Appendix}\par}
\addtocontents{toc}{\protect\qquad{Mappe 1}\par}
\addtocontents{toc}{\protect\qquad{Mappe 2}\par}
NOW, my problem is that the indentation is not working (see the uploaded file). E.g. I want the title "Electronic Appendix" to be aligned with "Appendix A", but it is indented. Likewise for the subsections. Is there some smart way of doing this, or is there something I should know about indentations in a TOC?
- Attachments
-
- tocExample.png.gz
- (141.7 KiB) Downloaded 407 times
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Get unnumbered Headings into the ToC
Stefan
Get unnumbered Headings into the ToC

The solution is actually really simple in my case: I simply added the package "tocloft", and then the alignment problem was solved! For the subsections I used "hspace{}" with a length of 1.5em:
Code: Select all
\addtocontents{toc}{\bigskip \textbf{Electronic Appendix}\par}
\addtocontents{toc}{\protect\hspace{1.5em}{DIR Channel Generators}\par}
\addtocontents{toc}{\protect\hspace{1.5em}{DIR Cpp Decoders}\par}