CTAN) does clever things with cross-references:
The Cleveref package (also available fromA number of other LaTeX packages provide similar features. Some are venerable enough to be documented in The LaTeX Companion, or even included in the standard LaTeX distribution itself. But all those that I've come across provide only a subset of the Cleveref features. (See the Introduction to the package documentation for some comparisons.)
Full documentation is available in a variety of formats, for download and viewing online. (Since the package is in DocTeX format, the source for the documentation is the same as the package itself.)
The latest release of the Cleveref package is version 0.21.5 (released March 2018).
For convenience, the most recent "stable" CTAN release is also available below, along with some older versions.
To install the package, follow the usual DocTeX installation procedure: extract the files, run the cleveref.ins
file through LaTeX, copy the resulting cleveref.sty
file to a directory in your TeX path, and run texhash
(or equivalent) to update your TeX database.
To build the documentation, run the cleveref.dtx
file through LaTeX, run makeindex -s gind.ist cleveref.idx
to build the index, then makeindex -s gglo.ist -t cleveref.glg -o cleveref.gls cleveref.glo
to build the change history, and finally run cleveref.dtx
through LaTeX one last time.
Bugs, feature requests, and any other feedback should be addressed to toby+cleveref@dr-qubit.org.
A list of known bugs, work-arounds, and possible future improvements is included at the end of the package documentation.
Toby,
your package is amazing! However, I ask for a small improvement, posing a second condition in the names of references: please disallow leading spaces. If you do that, you could enable code like
\cref{foo, bar}
(note the space after the comma) to handle references `foo' and `bar'. Right now (tested with v0.19 and v0.21) you get a warning like
LaTeX Warning: Reference ` foo' on page 1 undefined
instead… I can imagine that ignoring leading spaces would improve user friendliness.
Leave a comment
All comments are moderated. Clicking submit will open your email client and let you send your comment by email. By submitting your comment you agree to license the content under a Creative Commons Attribution-ShareAlike 4.0 International License.