# cross references different from tableofcontents

I have a document divided into \part \chapter \section and \subsection. I have 3 parts and in each part I reset all the counters.

I want that, when I do a crossref to something that is in the 1st part, chapter 3 and section 5, that LaTeX prints something like I-3.5, but I don't want that in the tableofcontents part that LaTeX prints the part number. For example, what I want is:

Part I

chapter 1 section 1.1 section 1.2

chapter 2

AND NOT

chapter I-1 section I-1.1 section I-1.2

chapter I-2

The command that I've tried

\renewcommand{\thechapter}{\thepart-\arabic{chapter}}
\renewcommand{\thesection}{\thechapter.\arabic{section}}


does exactly what I've said

Can anyone help me?

-

The macro \p@<counter> is added as prefix for references, thus the following should do the trick:

\documentclass{book}

\makeatletter
\renewcommand*{\p@chapter}{\thepart-}
\renewcommand*{\p@section}{\thepart-}
\renewcommand*{\p@subsection}{\thepart-}
\makeatother

\begin{document}
\ref{sec:firstfirstfirst} and \ref{sec:firstfirstsecond}
\tableofcontents
\part{First part}
\chapter{First chapter in first part}
\section{First section in first chapter in first part}
\label{sec:firstfirstfirst}
\part{Second part}
\chapter{First chapter in second part}
\section{First section in first chapter in second part}
\label{sec:firstfirstsecond}
\end{document}

-
Thank you very much –  Rui Martins Oct 9 '12 at 16:51