I use the LaTeX package titletoc to produce table of contents in some chapters or sections for Org-Mode LaTeX / PDF export with

#+TOC: headlines 1 local

But in the PDF file there is for example the following text before the table of content:

section.1 section.2 section.3 subsection.3.1 subsubsection.3.1.1 subsubsection.3.1.2 subsubsection.3.1.3 subsubsection.3.1.4 subsubsection.3.1.5 subsection.3.2

I have no idea about that. Perhaps somebody can give me a hint.

  • 1
    Did you turn off the normal TOC as the manual indicates? Also, did you customize org-latex-default-packages-alist to load titletoc before hyperref? – NickD Nov 9 '18 at 22:44

Like NickD wrote you have to load titletoc before hyperref.

My problem was that hyperref is loaded automatically through the variable org-lates-default-packages-alist and I defined my packages on a per file basis. So hyperref will always be loaded before the packages defined in the Org-Mode file. I have it now in my init.el.

Turning off the normal TOC has no effect or rather makes no problem if turned on.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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