# In memoir, how can I remove the table of contents from itself, while keeping its PDF bookmarkindex?

As suggested in answers to existing questions, it is possible to use tableofcontents* or \begin{KeepFromToc} in order to make the table of contents not contain an entry to itself.

However, when I use these commands to avoid the ToC self-reference, the table of contents also disappears from my PDF bookmarks. Is there a way I can add back the bookmark entry for the ToC without making it reference itself?

Something like this?

Define a hypertarget first, being the \tableofcontents* position and add a \pdfbookmark for this then. The default bookmark level is 0, seems to be alright for a ToC.

\documentclass{memoir}
\usepackage[bookmarksopen=true,bookmarksopenlevel=2]{hyperref}
\usepackage{blindtext}

\setcounter{tocdepth}{2}
\begin{document}
\phantomsection
\pdfbookmark{\contentsname}{toctarget}
\hypertarget{toctarget}{\tableofcontents*}

\chapter{First chapter}
\blindtext[5]
\section{First section}
\blindtext[5]
\subsection{First subsection}
\blindtext[5]
\end{document}

• I don't suspect strange characters in the \contentsname, so \texorpdfstring isn't needed, most likely. – user31729 Mar 31 '16 at 0:44