4

I am using cleveref for my thesis. When referencing another chapter, if I put the label at the top of the chapter, it will say "chapter X", but if I put the label after defining a new section or subsection, it will say "section X.Y", etc.

For consistency it would be nice to have everything referred to as "chapter" in this case. Is it possible to get cleveref to refer to sections in other chapters as chapters?

(NB: The thing I'd really like to do which may be difficult would be to have this only work for other chapters, so if I reference section Y within the current chapter, it would still say "section." But I recognize this may be quite challenging!)

1
  • Please provide a full MWE that shows what you're doing at the moment. Be sure to indicate which document class you use.
    – Mico
    Nov 11, 2014 at 15:39

1 Answer 1

2

It is very easy, I use this for documents in Norwegian (agreements and memos):

%% Referanser   
\RequirePackage{cleveref}
\IfLanguageName{norsk}{%
        \Crefname{section}{Punkt}{Punktene}
        \Crefname{subsection}{Punkt}{Punktene}
        \crefname{section}{punkt}{punktene}
        \crefname{subsection}{punkt}{punktene}
    }{}

To have everything referred to as chapters, use:

%% References   
\RequirePackage{cleveref}
\IfLanguageName{English}{%
        \Crefname{section}{Chapter}{Chapters}
        \Crefname{subsection}{Chapter}{Chapters}
        \crefname{section}{chapter}{chapters}
        \crefname{subsection}{chapter}{chapters}
    }{}

To achieve you second goal, I would personally chosen a manual approach and use the classic reference system, i.e. when in the same chaper, I would have used:

... see subsection~\ref{sec:section-label-in-the-current-chapter}

Not very fancy, but easy and much better than a complicated macro. Sometimes the simple solution is the best.

10
  • Thanks! Do you know if it's possible to have it distinguish between references within and outside the current chapter? It would be nice for sections within the current chapter to still be called "section."
    – Adam
    Nov 11, 2014 at 15:41
  • @Adam, then you might have to specify a method to determine which chapter we are currently in. I can thing of a few ways. However, as a reader I might find it odd so see a reference to Chapter 4.5. In my book that is Section 4.5.
    – daleif
    Nov 11, 2014 at 16:15
  • @daleif thanks, I'm still wrestling with it myself. For me it's a bit strange to have the choice to refer to Chapter 4 or Section 4.5 if I want to be specific about where in Ch. 4 the thing I'm mentioning is located.
    – Adam
    Nov 11, 2014 at 16:18
  • 1
    I think for most people the form of the number is selv explanatory. However you sometimes see some 'strange' people who numbers sections as 1,2,3 in each chapter. In which case you do need some kind of remedy when refering inside or outside the chapter. A construction like this is not something I would recommend as it might be more confusing than helpful to the casual reader.
    – daleif
    Nov 11, 2014 at 18:04
  • 1
    @daleif Maybe I was unclear, but we refer to the same practise, referring to a subsection as a compound numbered section (afsnit 2.3.3/avsnitt 2.3.3/punkt 2.3.3). But strictly speaking, the correct reference is to subsection (underafsnit 2.3.3/underavsnitt 2.3.3/underpunkt 2.3.3). So if you refer to chapter 2.3.4 or section 2.3.4 is mostly a matter of taste. My preference (and recommendation) is to refer to chapter and section, but leave the subsections etc.
    – Sveinung
    Nov 11, 2014 at 23:49

You must log in to answer this question.

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