[Tex/LaTex] Remove paragraph numbers, but still have bookmarks with hyperref

hyperref

How can I remove the numbers of my paragraphs, but still keep the links within my LateX file using hyperref?
It's a bit like this question, but then with paragraphs:
No section numbers, but still have PDF bookmarks with hyperref

Best Answer

Just set counter secnumdepth accordingly.

If the paragraph titles do not appear in the table of contents (counter tocdepth), then the depth can set to a different value for the bookmarks.

Full example:

\documentclass{article}
\usepackage{hyperref}
\usepackage{bookmark}
\bookmarksetup{
  open,
  numbered,
  depth=5, % otherwise the setting of counter `tocdepth' would be used
}
\setcounter{secnumdepth}{2}

\begin{document}
\section{Section}
\subsection{Subsection}
\paragraph{Paragraph}
\subparagraph{Subparagraph}
\end{document}

Result

Related Question