I tried





\theoremstyle{plain} %% This is the default, anyway



  \clist_map_function:nN { #1 } \ujs_printuptozero:n

\cs_new:Nn \ujs_printuptozero:n
  \int_compare:nTF { \value{#1}>0 } { \arabic{#1}. } { \clist_map_break: }


\chapter{First Chapter}

\section{First Section of First Chapter}


\chapter{Second Chapter}

\section{First Section of Second Chapter}


\section{Second Section of Second Chapter}

blah blah

As we saw in \ref{lemma_s_label}


which gives :

enter image description here

and :

enter image description here

I would have preferred something like As we saw in Chap. 1, Section 1, 1.1.1 rather than As we saw in 1.1.1 which is not helpful. Is there a way to achieve that with cleveref, or with other means that do not clash with the use of cleveref ?

  • Al always on this site you are much more likely to get help if you provide a full but minimal self contained example, including document class, preamble etc. Basically such that others have something to copy and test as is. Here we have to guess, and that seldom goes well.
    – daleif
    Oct 14 '19 at 14:43
  • @daleif I provided a minimal complete code.
    – Olorin
    Oct 14 '19 at 15:01
  • As a reader, I would find "As we saw in Chap. 1, Section 1, 1.1.1 ..." unbelievably tedious to read. I would much prefer to have to read either "As we saw in Lemma 1.1.1 ..." or (if can't be trusted to figure this out on my own...) "As we saw in Lemma 1.1.1 back in Chapter 1, Section 1, ...". What do you expect readers to get out of the "in Chapter 1, Section 1" affix? Are you anticipating that they'll understand the Lemma any better than without the affix?
    – Mico
    Oct 14 '19 at 15:09
  • Have a look at Grothendieck's EGA's that you may have heard of, labels there are expressed in this fashion when they point to another chapter (i.e. a chapter different from the ambient one), and they are in fact expressed in an even more compact way. I don't find it tedious to read. (You expressed your opinion, I expressed mine, fantastic.) (Note that such references are inherently rare compared to others references, i.e. references points inside the ambient chapter.) Regarding your last question : yes I anticipated that they will understand the lemma better with the affix. (I am kidding.)
    – Olorin
    Oct 14 '19 at 15:24

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.