2

I am writing a large document (guess what) with chapter, section, subsection, subsubsection (and paragrph).

I have changed the numbering to fit my taste:

\setcounter{secnumdepth}{3} % Number subsubsections
\def\thechapter       {\Roman{chapter}}
\def\thesection       {\arabic{section}}
\def\thesubsection    {\thesection.\arabic{subsection}}
\def\thesubsubsection {\thesubsection.\arabic{subsubsection}}

This is nice but I have a problem. Suppose that in chapter II, I write a reference to section I.2. It will be rendered as 2 (ie, no chapter information).

Is there a way to deal with that?

Thanks in advance.

P.S.: for details I use hyperref (the link points to the right section) and autoref.

3
  • 1
    \def\thesection{\thechaper.\arabic{section}}? Or do you don't want your section titles also labeled "I.2" etc.? Jul 13, 2011 at 16:31
  • Exactly: I don't want section titles labeled I.2 but I want references in the form I.2 (in fact "section 2 of chapter I" would be better). Jul 15, 2011 at 11:28
  • 1
    This sound similar to \autoref of hyperref. Have a look on its manual. Jul 15, 2011 at 11:36

1 Answer 1

4

Add the reference prefix, which is printed just before the label value, manually:

\makeatletter
\renewcommand{\p@section}{\thechapter.}
\makeatother
2
  • Thanks that work pretty well. I guess I have to do the same with \p@subsection and \p@subsubsection. I have read some advices that this is weird (because strictly speaking section "I.2" will never be printed). May I ask your advice? Jul 15, 2011 at 11:28
  • 1
    @Mathieu: If your section counter is reset at each chapter, then chapter number should also be included. Otherwise, it's a matter of your choice. Some people prefer to have a hint on where a particular section is located. Jul 15, 2011 at 14:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .