\documentclass[11pt]{article}
\usepackage{refcheck}
\textwidth=360pt
\begin{document}
\baselineskip=4.5mm
\textheight=40\baselineskip
\pagestyle{myheadings}

\parindent=1em\parskip=0.75ex
\makeatletter

\thispagestyle{empty}

\def\RefCheck{\textsl{Refcheck\/}}
\def\AmS{\mbox{$\mathcal{A}$\kern-0.17em\raise-2.1pt\hbox{$\mathcal{M}$}%
\kern-0.115em$\mathcal{S}$}}
\renewcommand{\refname}{{\normalsize References}}
\def\curversion{1.6a}
\def\curvertime{2000/01/17}

\section*{\RefCheck{\tiny${}^{\mathrm{\ \ ver. 
\curversion}}_{\mathrm{\curvertime}}$} for \LaTeXe}
\markboth{\hfill\bfseries\RefCheck\ for \LaTeXe\hfill}%
{\hfill\bfseries\RefCheck\ for \LaTeXe\hfill}
This short demo file describes usage of \RefCheck\ package
with \LaTeXe. The package looks for useless labels,
unlabelled equations, unused bibliography references
and puts `keys' of labels on margins.

To start checking one should just write
\begin{verbatim}
     \documentclass{article}
     \usepackage{refcheck}
\end{verbatim}
at the beginning of document and compile the file twice.
Then, comments on references could be found in \texttt{.log} file and 
in the margins.

Consider the set of equations
\begin{eqnarray}
&&a=b\label{eq.1}\\
&&b=c\label{eq.2}\\
&&c=d,
\end{eqnarray}
written as
\begin{verbatim}
     \begin{eqnarray}
     &&a=b\label{eq.1}\\
     &&b=c\label{eq.2}\\
     &&c=d,
     \end{eqnarray}
\end{verbatim}
Then the \texttt{.log} file will contains the following messages:
{\small
\begin{verbatim}
 LaTeX Warning: <by RefCheck> Unused label `eq.2' on page 1
         on input line 42.
 LaTeX Warning: <by RefCheck> Unlabelled equation (3) on page 1 
         on input line 44.
\end{verbatim}
}
\noindent
because the equation (\ref{eq.1}) is
referenced here by \verb#(\ref{eq.1})#, the label {\tt eq.2} of the second
equation is not used and the last equation is numbered but it is not
labelled.

The labels identifiers in the marginal notes are stated under the
option \textit{showrefs\/} (it is default) or by the command
\verb#\showrefnames#.  This regime can be set off by the option
\textit{norefs} or (at any point of text) by the command
\verb#\norefnames#.

These marks include some information on labels.  Namely, the useless
labels are underlined and bounded by `\texttt{?}', the mark `\unl@bld@mark'
means that the equation is unlabelled.  The marks are framed for
labels which are used in text.  

\newpage

The package is working in the same way with bibliography.
Consider the short list of books:

\vspace{-1\baselineskip}

\begin{thebibliography}{9}
\bibitem{book1}A book.
\bibitem{book2}Another book.
\bibitem{book3}Third book.
\end{thebibliography}
defined as follows
\begin{verbatim}
     \begin{thebibliography}{9}
     \bibitem{book1}A book.
     \bibitem{book2}Another book.
     \bibitem{book3}Third book.
     \end{thebibliography}
\end{verbatim}
Further, we use the labels of \cite{book1,book2} with the
command \verb#\cite{book1,book2}# and do not use the label
`book3'. Then, the \texttt{.log} file will contain the following message
{\small
\begin{verbatim}
 LaTeX Warning: <by RefCheck> Unused bibitem `book3' on page 2 
        on input line 89.
\end{verbatim}}

Commands \verb#\showcitenames# and \verb#\nocitenames# for
bibliography are analogous to the commands \verb#\showrefnames# and
\verb#\norefnames#.  They set on and off \RefCheck\ to write labels of
bibitems to output.  The same function is for the options
\textit{showcites\/} (default) and \textit{nocites}.

Options \textit{msgs\/} (default) and \textit{nomsgs\/} state whether
\RefCheck\ writes its messages to \texttt{.log} file or not.

The check of unlabelled equations can be switched off by the option
\mbox{\textit{ignoreunlbld\/}} and on (it is set by default) by the option
\textit{chkunlbld\/}.

\medskip

\RefCheck\ generally works with \AmS-\LaTeX\ 
(tested for \AmS-\LaTeX\ 1.2, 1996/12/19), 
but the \textit{amsmath\/} package must be loaded \underline{before} the \RefCheck\ package.

\medskip

Note the problem with implicitly cited labels.  For
example, if there is a set of equations which are labelled with
$\,$\texttt{a1,a2,...an}$\,$ and referred in document by
\verb#(\ref{a1})--(\ref{an})#, then the labels
$\,$\texttt{a2,a3,...an-1}$\,$ cannot be recognized as `used'.

\newpage

\textbf{Summary of options and commands:}
\medskip

\begin{tabular}{|l|l|c|l|}
\hline
Option & Command & Switch & Function\\
\hline
showrefs$^{*}$ & \verb#\showrefnames# & on & to put labels identifiers\\
\cline{1-3}
norefs & \verb#\norefnames# & off & in the marginal notes\\
\hline
showcites$^{*}$ & \verb#\showcitenames# & on & to put bibitem identifiers\\
\cline{1-3}
nocites & \verb#\nocitenames# & off & in the marginal notes\\
\hline
msgs$^{*}$ & \verb#\setonmsgs# & on & to write \RefCheck's\\
\cline{1-3}
nomsgs & \verb#\setoffmsgs# & off & messages to \texttt{.log}\\
\hline
chkunlbld$^{*}$ & \verb#\checkunlbld# & on & to check unlabelled\\
\cline{1-3}
ignoreunlbld & \verb#\ignoreunlbld# & off & equations\\
\hline
\end{tabular}\\
\mbox{\qquad}$*$ default

\bigskip

\textbf{Versions of \RefCheck, acknowledgments and bugs:}
\begin{itemize}
\item
Versions \textbf{1.0--3} worked with \LaTeX2.09.  Many
thanks to Antonio Loria for his useful comments on those versions. 
Version \textbf{1.2} of \RefCheck\ can be found in
\texttt{/tex-archive/obsolete/macros/latex209/contrib/} of CTAN. 

\item
\textbf{1.4} was the first version of \RefCheck\ for \LaTeXe, it had a number
of bugs in its functionality for \AmS-\LaTeXe's \verb#\eqref#,
\verb#\tag#, \verb#split# and \verb#multline#.  Many thanks to
Cornelius C. Noack and Mikhail Zotov for finding the problem.

\item
In \textbf{1.5} the problems were corrected, but it was found (thanks to
Mikhail Zotov) that the version marks \AmS-\LaTeXe's \verb#equation*#
and \verb#gather*# as unlabelled.  The problem has been corrected in
the version \textbf{1.6}.

\item
\textbf{\curversion} is the current version, this is the version 
\textbf{1.6} with minor modification of the code.
\end{itemize}

\bigskip

\textbf{Changes:}
\begin{itemize}
\item
Version \textbf{1.5}: new options \textit{msgs\/} and \textit{nomsgs\/}.

\item
Version \textbf{1.6}: new options \textit{ignoreunlbld\/} and
\textit{chkunlbld\/} (suggested by Miroslav Fikar).  Another scheme of
work with \verb#\bibitem# and \verb#\cite# to improve compability with
other packages (in particular with \textit{hyperref\/}). 
\end{itemize}

\end{document}

