## Wednesday, June 27, 2007

### paralist, varioref, and hyperref: a happy combination

Consider the following...
\usepackage{varioref}\labelformat{equation}{\textup{(#1)}}
This uses the clever varioref package to alter how equation references are displayed. The reference will be displayed with parentheses around the reference and the whole thing will be forced upright (so things don't look stupid in an italicized theorem environment). For example, for an equation labeled "eq:1" and a figure labeled "fig:1", I get these results:
\ref{eq:1} produces "(1)"
\ref{fig:1} produces "1"
This removes the need for \eqref from amsmath; just use \ref instead. Now, let's add hyperref:
\usepackage{hyperref}
So,
\autoref{eq:1} produces a linked "Equation (1)"
\autoref*{eq:1} produces an unlinked "Equation (1)"
\autoref{fig:1} produces a linked "Figure 1"
\autoref*{fig:1} produces an unlinked "Figure 1"
So this gives us the equivalent of an unlinked "\eqref*" through \ref*. Now, let's add paralist...
\usepackage{paralist}\labelformat{equation}{\textup{(#1)}}
and an enumerate environment with automatic bracketed lowercase roman numeral numbering...
\begin{enumerate}[(i)]    \item This is item one. \label{item:1}    \item This is item two. \label{item:2}\end{enumerate}
The \label macros can be associated with any enumerate item, even without paralist. The package paralist allows us to easily customize the displayed labels (enumitem is nice alternative). So, we get an enumerated output like...
 (i) This is item one.(ii) This is item two.
Now we get...