I'm quite often using references to corresponding sections or text blocks in my thesis.
In consequence, I've already defined a lot of \label{}
commands, which I tried to classify with a naming convention like int:txt:WhatIsItAbout
for making clear, that it is in the Chapter introduction, refers to a text block and it's about ...
However, all the page references only contain the page where the label is typeset. If I'm referring to a chapter or section which spans more than one page, I'd like to have a page number like S. 23f or S. 23ff
By referencing text blocks it seems even more complicated (as the end of the range is not defined by the occurrence of the next object on the same level): I add a label somewhere, but to define a text range, I would have to define a second label at the end of the text block which would make things even more confusing.
I know about the varioref
package which can produce such "intelligent" references, but for a page range it also needs 2 labels.
(as described here: Creating a "\label" that, if necessary, spans over several pages)
- Is there a way to avoid that by e. g. defining an environment which
- can be referenced and which automatically outputs the start and end page?
- or which creates 2 labels at its beginning and at its end which are e. g. called LabelnameS and LabelnameE (for start and end) and
- can be read by either the
\vref
command with explicitly entering the 2 label names - or by a specially defined ref command
\rangeref{Labelname}
which expands it automatically and creates the page range, if start and end are on different pages.
- can be read by either the
Remark: However, if really an environment would be used for that, it could cause problems if 2 such environments "intersect" (start of 2nd environment before end of first, but end of second environment after end end of first).
- How do you handle that?
- Do you avoid referencing to page ranges or do you always create 2 labels?
- How do you name your labels to make them short and clear?