You may want to refer to some items by name when you type your document, but have the name replaced by the appropriate number when the document is processed. The Bolzano-Weierstrass Theorem of chapter 2, for example, is theorem 2.0.1. Items that can be referenced in this way are: chapters, appendices, sections, subsections, theorem-like objects, exercises, figures, page numbers and equation numbers.
You assign a name to an object like this:
\thmrdef{thm:Bolzano-Weierstrass}
This works for all theorem-like objects; other commands are described
in the next section. The command that defines a name must come after
the item—for example, the definition above must come after the
\thm
command for the Bolzano-Weierstrass theorem.
You refer to a named item like this:
\xrefn{thm:Bolzano-Weierstrass}
. (You use the same macro
\xrefn
for all references.) The code
recall that theorem \xrefn{thm:Bolzano-Weierstrass}
implies\dots
produces this:
recall that theorem 2.0.1 implies…
The \xrefn
macro also emits $\TeX$ specials that will create live
links if the output is converted to a pdf file with dvipdfm
. The
references will show up in blue, and clicking on a reference will jump
to the referent. The page numbers in the table of contents and the
index will also be live links.