Rótulos diferentes para títulos e referências de subseções

Rótulos diferentes para títulos e referências de subseções

Estou construindo minha tese e usando uma variante da classe report. Tenho capítulos, seções, subseções e subseções em alguns lugares. Ao ler o texto, ter uma longa sequência de números, letras e algarismos romanos no título das subseções e subseções é desagradável. Eu preferiria que esses títulos tivessem apenas o título da subseção ou subseção relevante, e fizesse isso usando:

\renewcommand\thesubsection{\Roman{subsection}}

(Dependendo da aparência das coisas, posso incluir o contador de seções, mas definitivamente retirarei o contador de capítulos.) No entanto, quando faço uma referência à subseção ou subsubseção, preferiria muito mais a sequência inteira de números a ser usado, caso contrário a referência será mal definida. Alguém pode comentar sobre como fazer isso?

Aqui está um exemplo mínimo.

\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}

Responder1

Redefinir \p@subsection(o prefixo utilizado para as referências às subseções):

\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}

insira a descrição da imagem aqui

A propósito, nunca use a combinação \\ + blank line; isso gerará avisos de caixas insuficientemente cheias.

Responder2

As referências podem ser automaticamente prefixadas por \p@<counter>, veja exemplo:

\documentclass{report}
\usepackage{parskip}

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

\makeatletter
\renewcommand*{\p@subsection}{\thesection.}
\makeatother

\begin{document}
\chapter{Chapter}

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

\section{Section}

\subsection{Subsection}\label{subsection}

\end{document}

Resultado:

Resultado

informação relacionada