This would be useful in order to do such things as be able to refer to what chapter (or section or subsection or whatever) we are in.
My particular usage involves needing to number figures and tables in a chapter.figure format like:
Figure 7.1 Examples of Lepidoptera spp.
Use of things like $hn, $position, and $parentposition don’t work because the chapters are broken down into parts, and often the figures and tables are buried in the hierarchy in subsections. This is a very common way in which technical books are written, so the fact that I can’t find out what chapter I’m in to properly label things is hair tearing out level.
I suggest an extension to the reference syntax so that <$n#chapter> would give the current value of the chapter counter. In a link it should give the chapter counter that would be current in the document linked to in a link so that:
Figure <$n#chapter>.<$n#table:<$title_no_spaces>>
in a link in chapter 14 that references the above Lepidoptera figure in chapter 7 will produce:
Figure 7.1