简体   繁体   中英

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

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.

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

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.

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}%

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM