Using advanced referencing
LaTeX helps with automating all kinds of references. It's not only limited to numbering. LaTeX can even automate naming and phrasing. We will dig deeper into that here.
Producing intelligent page references
The varioref
package offers a command to add on the preceding page, on the following page, or the page number to a reference, depending on the context.
We will use the varioref
commands to introduce variable references, \vref
, and \vpageref
, to achieve enhanced reference texts:
- Open our current example from the Setting labels and references section. Add the
varioref
package to your preamble. Use thenospace
package option, which ensures thatvarioref
doesn't insert additional undesirable space before or after a reference:\usepackage[nospace]{varioref}
- Edit the content of the second chapter in our example code:
\emph{amsmath}, on position \vref{item:amsmath} of the top list in section~\vref{sec:packages}, is indispensable to...