Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
1  
\def\thesection{\thechaper.\arabic{section}}? Or do you don't want your section titles also labeled "I.2" etc.? –  Martin Scharrer Jul 13 '11 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). –  Mathieu Dubois Jul 15 '11 at 11:28
1  
This sound similar to \autoref of hyperref. Have a look on its manual. –  Martin Scharrer Jul 15 '11 at 11:36

1 Answer 1

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

\makeatletter
\renewcommand{\p@section}{\thechapter.}
\makeatother
share|improve this answer
    
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? –  Mathieu Dubois Jul 15 '11 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. –  Andrey Vihrov Jul 15 '11 at 14:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.