Hi
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
General ⇒ Get unnumbered Headings into the ToC
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
Get unnumbered Headings into the ToC
Hi Jonathan,
you could use
Stefan
you could use
\addtocontents
, such as
Code: Select all
\addtocontents{toc}{File name}
LaTeX.org admin
Get unnumbered Headings into the ToC
I actually tried that, but it did not appear in the TOC:
It turns out it must be put on the same page as some other content, so eventually I put it in the end of my last appendix, and not after the appendix (although this can also be done by adding a mbox{}, but then another empty page will be added).
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?
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 410 times
Last edited by Stefan Kottwitz on Sun Aug 12, 2012 4:00 pm, edited 1 time in total.
- Stefan Kottwitz
- Site Admin
- Posts: 10348
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Get unnumbered Headings into the ToC
As the layout of the table of contents depends on the document class, perhaps also on packages and settings, please post the necessary details, i.e. class name and related settings.
Stefan
Stefan
LaTeX.org admin
Get unnumbered Headings into the ToC
I have actually just found a way to solve this, so it all works now. But thanks anyway, Stefan 
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:
I'm sure someone could come up with a better design solution, but I think looks okay.

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}
Last edited by Stefan Kottwitz on Sun Aug 12, 2012 5:09 pm, edited 2 times in total.