[Tex/LaTex] Different labels for subsection titles and references

cross-referencingnumbering

I am constructing my thesis, and am using a variant of the report class. I have chapters, sections, subsections, and subsubsections in places. When reading the text, having a long string of numbers, letters, and roman numerals in the title for subsections and subsubsections is unpleasant-looking. I would prefer these titles to just have the relevant subsection or subsubsection title, and do so using:

\renewcommand\thesubsection{\Roman{subsection}}

(Depending on how things end up looking, I may include the section counter, but I'll definitely strip off the chapter counter.) However, when I make a reference to the subsection or subsubsection, I would much prefer the entire string of numbers to be used, otherwise the reference is poorly defined. Can anyone comment on how to do this?

Here is a minimal example.

\documentclass{report}

\begin{document}

\renewcommand\thesection{\arabic{chapter}.\arabic{section}}
\renewcommand\thesubsection{\Roman{subsection}}

\chapter{Chapter}

\section{Section}

\subsection{Subsection}\label{subsection}

\noindent I have the subsections labelled in Roman in the title, because 1.1.I would just be long.
\\

\noindent Here is a reference to the subsection: (\ref{subsection})
\\

\noindent I would like references to the subsection to be (1.1.I), however.

\end{document}

Best Answer

Redefine \p@subsection (the prefix using for the references to subsections):

\documentclass{report}

\renewcommand\thesection{\arabic{chapter}.\arabic{section}}
\renewcommand\thesubsection{\Roman{subsection}}
\makeatletter
\renewcommand\p@subsection{\thesection.}
\makeatother

\begin{document}

\chapter{Chapter}

\section{Section}

\subsection{Subsection}\label{subsection}

\noindent I have the subsections labelled in Roman in the title, because 1.1.I would just be long.

\noindent Here is a reference to the subsection: (\ref{subsection})

\end{document}

enter image description here

By the way, never use the combination \\ + blank line; this will generate underfull boxes warnings.

Related Question