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?
Best Answer
When you use the starred version the reference counter is not updated. If you don't want numbering below subsection, just change the
secnumdepth
counter. The following code demonstrates this:Resulting in: