LaTeX: disable or turn off hyperlinking for table of contents?

6.3k views Asked by At

I want a table of contents, but I don't want each line to be a clickable hyperlink. How do I do this?

Details: I am using the \anothertoc command from the shorttoc package to "import" the TOC from another document. Works fine, except that all the links for the imported TOC are broken (obviously)... so, I want to de-linkify them.

Not sure whether this is relevant, but the TOC that I'm importing is from a document that uses the hyperref package. I have a feeling that hyperref is making the TOCs hyperlinked, but I can't find any option for the hyperref package to disable hyperlinking for TOCs.

3

There are 3 answers

1
Theo Guyard On

You can consider the linktoc parameter when importing the package with for instance \usepackage[linktoc=none]{hyperref} or \usepackage[linktoc=page]{hyperref}. You can refer to paragraph 5.13 of the manual at https://mirrors.chevalier.io/CTAN/macros/latex/contrib/hyperref/doc/hyperref-doc.pdf

2
Mica On

How are you "importing" the toc?

I'd have a look at the hyperref manual at : http://www.tug.org/applications/hyperref/manual.html

The simple solution would be to turn off hyperlinking in the document toc that you are importing, though I realize that might not be possible.

0
letax On

A solution using Normadize's answer based on \NoHyper working well with the shorttoc package:

{\protect\NoHyper%
\anothertoc{other-document}{Toc from other document}{1}
\protect\endNoHyper}%