I'm using titlesec to define the layout of my headings. It's working but I've run into a problem when I use the package to define the layout of \part's.
When I try to reference to a \part, which is defined with titlesec, using \nameref I get the wrong title.
Does anybody know a workaround for this or what I'm doing wrong? I've made this example to show what I'm talking about:
\documentclass{report}
\usepackage{titlesec}
\usepackage{hyperref}
% If you uncomment the following 5 lines the nameref in line 16 will refer to "Chapter title 2" instead of "Part title 2"
%\titleformat{\part}[display]
% {\Huge\filcenter}
% {\partname{} \thepart}
% {0em}
% {\hrule}
\begin{document}
\part{Part title 1}
\chapter{Chapter title 1}
Hello have a look at \autoref{part:part_2} \nameref{part:part_2}
\chapter{Chapter title 2}
\part{Part title 2}\newpage
\label{part:part_2}
\chapter{Chapter title 3}
\end{document}
Looking forward to hear your input.
classicthesis.styand forchapterrather thanpart. This works, thanks a lot! – euronion Aug 12 '23 at 18:35