I am writing a thesis with document class report and I am using hyperref. My structure is the following:
\chapter{First chapter}
\section{First section}
\subsection{First sub section}
\subsubsection*{My Section}
However, I'd like to reference the \subsubsection
with their name, but I don't want to number them (at all in the whole document). For example, I could write (using \nameref
command):
In Section "My Section" we saw that...
However, if I add label to that section, it references to the subsection (First sub section). This is what I have:
\phantomsection
\addcontentsline{toc}{subsubsection}{My title}
\subsubsection*{My title}
\label{sec:mysection}
Moving \label
command between \phantomsection
and \addcontentsline
makes it reference to the previous subsection. How could I make it refer to the unnumbered subsubsection?
secnumdepth
counter to2
. This will cause only parts, chapters, and sections to be numbered. It allows you to write\subsubsection
instead of the starred variant. If you then later decide that you do want to number them, the change is limited to the counter instead of removing*
throughout your document. You can use thenameref
package to reference sections by name. – Roelof Spijker Nov 23 '11 at 11:03