[Tex/LaTex] invisible subsection

bookmarkssectioning

I've tried adapting the answer here, to make invisible subsections by changing 'section' to 'subsection' everywhere.
It didn't seem to work.
Basically, what I want is to have subsections that appear in the bookmarks menu of adobe (or other pdf readers) so that I can't jump to their location, but they shouldn't appear in the text itself.
Ideally I would prefer these subsections (or sections for that matter) didn't interfere with the numbering of regular subsections, but that's the less important part.

Best Answer

You want to use the command \addcontentsline to add something to the table of contents.

\documentclass{report}
\usepackage{blindtext}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\section{You can see this section}
\blindtext

\addcontentsline{toc}{subsection}{You can't see this one}

\blindtext
\subsection{You can see this one!}

\blindtext
\end{document}

This will put an unnumbered entry at the level of subsection into the \tableofcontents and and entry in the index! More information can be found here.