0

When I use cleveref-based cross-references to, say, sections in another chapter, these references just print Section n. It's then difficult to distinguish references to a section of another chapter from references to a section of the present chapter. I'm using the amsbook documentclass, as @Mico points out is important to mention.

I presume there's a good pre-built solution to this issue---what is the existing pre-built, pre-packaged solution? Again, this is I assume a well-trod issue, so I'd love to know the generally accepted solution rather than rolling my own.

I'd certainly rather avoid having to manually write \cref{sec:section} of \cref{chap:chapter} in the relevant places.

I'd also rather avoid having to change the style to display as Section n.m everywhere, or further as Subsection n.m.k. Most of the time these references are within the same chapter or section, so it'd be nice to show only external structure when relevant.

I'd be fine with generating Section m of Chapter n automatically, or switching to the notation of Section n.m, when relevant.

I'm currently using varioref as a workaround, and I also use hyperref in my document.

The following seem strongly related:

  • 1
    Please tell us (a) which document class you employ, (b) how chapters are numbered in the document (arabic numerals?, Roman numerals?, something else?), and (c) how \thesection is defined in your document. Your write-up gives the impression that \thesection has been (re)defined to show just the section number -- without a chapter number prefix. Is this impression correct? – Mico Aug 13 at 16:55
  • @Mico, thank you for the suggestions and improvements! I'm using amsbook. chapters, sections and what have you are numbered by arabic numerals. From looking at the documentation, I believe thesection is defined thusly: \def\thesection{\arabic{section}}. Regardless, I believe your impressions are correct. – Jason Hemann Aug 13 at 20:05
  • Prefixing the chapter number to cross-referenced section numbers is straightforward if all such cross-references get this treatment. I'm afraid I have no idea how to go about meeting your criterion that the prefixing of the chapter number in a cross-reference should occur only if the cross-reference pertains to a section not in the current chapter. – Mico Aug 13 at 21:45
  • @user194021, thank you for the related suggestion! I hadn't looked at this as a "parent counter" problem. I think the crux of the difference in the questions, as far as I can tell, is that I'm looking for some pre-built, pre-packaged solution to crack this, rather than rolling my own. It seems like my preferred solution will be zref-related, but I need to continue looking at the relevant questions' answers. – Jason Hemann Aug 14 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.