I have an appendix in my document which I want to reference by its name in the text. I use the starred \section* command here, because I do not want the appendix to appear in the TOC. However, \nameref simply puts an empty space where the word "Appendix" should be.
Thanks to the comments, I now can see that the problem is actually the titlesec package. I want my section Appendix to appear as a non-numbered item in the TOC, but at the same time, I want to do there referencing with \nameref as explained above. So I edited my example to now look like this:
\documentclass[11pt, oneside, a4paper]{article}
\usepackage{titlesec}
\titleformat{\section}{\normalfont\LARGE\bfseries}{\thesection}{1em}{}
\titleformat{\subsection}{\normalfont\Large\bfseries}{\thesubsection}{1em}{}
\titleformat{\subsubsection}{\normalfont\large\bfseries}{\thesubsubsection}{1em}{}
\titleformat{\paragraph}[runin]{\normalfont\large\bfseries}{\theparagraph}{1em}{}
\usepackage[hidelinks]{hyperref}
\usepackage{nameref}
\newcommand{\sectionbreak}{\clearpage}
\begin{document}
\tableofcontents % added this line
\section{Section 1}
\label{sec:section_1}
All that can be seen in the \nameref{sec:appendix}.
\section*{Appendix}
\label{sec:appendix}
\addcontentsline{toc}{section}{Appendix} % added this line
Here comes the appendix.
\end{document}
titlesecand the\sectionbreakis removed – daleif Nov 04 '20 at 14:07titlesecto adjust my heading styles. Is there any way how I can do that and still use\namerefin the way I want? – s6hebern Nov 04 '20 at 14:55{\normalfont\LARGE\bfseries}{\thesection}{1em}{}with Calibri as the default bold font. – s6hebern Nov 05 '20 at 08:54