The title may seems unclear.
I have a document with several parts, including several chapters. I want the numbering of the chapter to be reset after each new part (easy) BUT : - I want the header of my chapter to be just the number of the chapter (not Part.Chapter) - I want the ToC to show the same thing (not the part number for each chapter and section) - I want the ref to a chapter or a section to be Part.Chap(.sec etc).
Here is a MWE with the package I use in my thesis. It looks almost fine. Just the reference to chapter "I.1" does not work.
\documentclass[twoside,12pt,openright,a4paper,usenames,dvipsnames]{book}
\usepackage[linktoc=all,hyperindex]{hyperref}
\usepackage{chngcntr}
\counterwithin{chapter}{part}
\usepackage{titlesec}
\usepackage[titles]{tocloft}
\titleformat{name=\chapter}[display]
{\bfseries\LARGE}
{\filleft\MakeUppercase{\chaptertitlename} \Huge\thechapter}
{0ex}
{%\titlerule
\vspace{2ex}%
\filleft}
[\vspace{4ex}%
\titlerule]
\titleformat{name=\chapter,numberless}
{\bfseries\LARGE}
{}
{0ex}
{%\titlerule
\filleft\MakeUppercase}
[\vspace{4ex}%
\titlerule]
\titlespacing*{\chapter}{0pt}{-25pt}{40pt}
\titleformat{\part}[frame]
{\bfseries\Huge}
{\filright\large\enspace{\partname}\enspace}
{40pt}
{\Large\filcenter\MakeUppercase}
\titleclass{\part}{top}
\begin{document}
\tableofcontents
\part{Part 1}
\chapter{Chap 1}
\label{chap:chapI1}
\chapter{Chap 2}
\part{Part 2}
\chapter{Chap 1}
As mentioned in chap.~\ref{chap:chapI1},...
\chapter{Chap 2}
\end{document}
Do you know how I can fix the refs ? I browsed similar question, but none answer in the case of titlesec use.