« Counters | Table of Contents | Definitions »
One reason for numbering things like figures and equations is to refer the reader to them, as in “See Figure 3 for more details.”
\label
Command:
\label{key}
A \label command appearing in ordinary text assigns to the key the number of the current sectional unit; one appearing inside a numbered environment assigns that number to the key.
A key can consist of any sequence of letters, digits, or punctuation characters. Upper and lowercase letters are different.
To avoid accidentally creating two labels with the same name, it is common to use labels consisting of a prefix and a suffix separated by a colon. The prefixes conventionally used are
cha for chapters
sec for lower-level sectioning commands
fig for figures
tab for tables
eq for equations
Thus, a label for a figure would look like fig:bandersnatch.
\pageref
Command:
\pageref{key}
The \pageref command produces the page number of the place in the text where the corresponding \label command appears. ie. where \label{key} appears.
\ref
Command:
\ref{key}
The \ref command produces the number of the sectional unit, equation number, … of the corresponding \label command.
« Counters | Table of Contents | Definitions »