# How to Remove the Self adding TOC and still keeping the \hyperef to the TOC?

Hey anyone know how to keep the link to TOC due to \hyperref but still be using something like \tabelofcontents* og \keepFromToc to hide the TOC link in the table of contents.

First time asking here and first time I'm using Latex.

• Welcome to TeX.SX! Please rephrase your question. It's a little bit difficult to understand. Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 May 27 '15 at 17:07
• It might help if you explained what you mean? Self adding toc in the toc? Is it \tableofcontents* you are looking for? As always it is a good idea to provide a minimal example, a self contained document that others can copy and fun on their own systems. – daleif May 27 '15 at 17:07
• Then copy the big document into a new file or folder and start removing stuff that is not relevant. I still do not understand what it us you are looking for. So a code example is necessary. – daleif May 27 '15 at 17:38
• This is still as clear as mud. Please explain, in detail, what you mean by "self-adding to the ToC" and "keeping \hyperref to the ToC". It's not clear at all. – Werner May 27 '15 at 17:41
• @Michael: Ahhh, these are referred to as bookmarks. And yes, hyperref automatically inserts a bookmark for every entry into the regular ToC. So you want only the bookmarks and no visible ToC in your document? – Werner May 27 '15 at 18:58

The question is still unclear to me, but I understood it this way:

• Add a bookmark to the ToC
• Don't add a ToC entry in the ToC itself.

This can be achieved, for example, bu manually adding the bookmark with a dest=toc::label (or use a different name.).

Use \hypertarget{toc::label}{} with an empty anchor just before \tableofcontents* will define the destination label, saying \bookmark[dest=toc::label]{\contentsname} will just add the bookmark entry.

Note: \blinddocument is just a quick way to build up a dummy document. It can be removed.

\documentclass{memoir}

\usepackage{blindtext}
\usepackage{hyperref}
\usepackage{bookmark}

\begin{document}

\hypertarget{toc::label}{}
\bookmark[dest=toc::label]{\contentsname}
\tableofcontents*

\blinddocument

\end{document}


• You are a Champ Christian. That was exactly what i was looking for, sorry for me bad explanation. Thanks alot :) – Michael May 28 '15 at 17:39
• You're welcome. Happy TeXing – user31729 May 29 '15 at 5:06