1
% ****** Start of file reftest.tex ******
3
% This file is part of the APS files in the REVTeX 4.1 distribution.
4
% Version 4.1 of REVTeX, July 1, 2008.
6
% Copyright (c) 2009 The American Physical Society.
8
% See the REVTeX 4.1 README file for restrictions and more information.
10
\documentclass{revtex4}%
13
\typeout{Filename: reftest4-1.tex for revtex 4.1i 2009/10/19 (AO)}
14
% This document, when typeset, prompts for the name of a LaTeX auxiliary (.aux) file
15
% and then processes that file, paying attention to
16
% keys that have been cited (via \citation)
17
% or defined (via \bibcite).
18
% It then prints out diagnostics indicating
19
% * any keys that were cited but never defined,
20
% * any keys that were defined but never cited, and
21
% * keys that were cited and defined, but not in the same order.
23
% BibTeX takes care of such things automatically,
24
% so there is little use for such a test when using BibTeX.
26
% A separate question: will this file run under revtex4.cls?
27
% I can see two lines in my .aux with the potential for problems:
28
% \global \mathchardef \firstnote@num\z@ \relax
29
% \global\NAT@numberstrue
36
\let\bibdata\g@bble@ne
37
\let\newlabel\g@bbletw@
38
\let\@writefile\g@bbletw@
39
\let\bibstyle\g@bble@ne
45
\advance\@tempcnta\@ne
46
\expandafter\bib@one\csname bib#1\expandafter\endcsname\expandafter{\the\@tempcnta}{#1}%
51
\typeout{*** Tag "#3" used in more than one \string\bibitem.}%
52
\typeout{\space\space\space\space You must correct this problem before continuing (Bailing out).}%
56
\expandafter\def\csname bib@num#2\endcsname{#3}%
61
\@for\@tempa:={#1}\do{%
62
\expandafter\cite@one\csname cite\@tempa\expandafter\endcsname\expandafter{\@tempa}%
67
\expandafter\@ifx\expandafter{\csname cite*\endcsname#1}{%
68
\@booleantrue\@cite@star@sw
72
\advance\@tempcntb\@ne
73
\expandafter\cite@one@\expandafter#1\expandafter{\the\@tempcntb}{#2}%
77
\expandafter\def\csname cite*\endcsname{*}%
78
\@booleanfalse\@cite@star@sw
80
\def\cite@one@#1#2#3{%
82
\expandafter\def\csname cite@num#2\endcsname{#3}%
85
\def\strut{\vrule height12pt depth4pt width0pt}%
87
\typein[\filename]{Type in file name (no extension)}%
88
\expandafter\input\expandafter{\filename.aux}%
90
\expandafter\def\expandafter\bibtotal\expandafter{\the\@tempcnta}%
91
\expandafter\def\expandafter\citetotal\expandafter{\the\@tempcntb}%
93
\def\app@undefined#1#2#3{%
94
\expandafter\@ifnotrelax\csname#2#1\endcsname{}{%
99
\let\uncitedbibs\@empty
101
\@ifnum{\bibtotal>\@tempcnta}{%
103
\advance\@tempcnta\@ne
104
\expandafter\app@undefined\csname bib@num\the\@tempcnta\endcsname{cite}\uncitedbibs
105
\@ifnum{\bibtotal>\@tempcnta}%
109
\let\undefinedcites\@empty
111
\@ifnum{\citetotal>\@tempcnta}{%
113
\advance\@tempcnta\@ne
114
\expandafter\app@undefined\csname cite@num\the\@tempcnta\endcsname{bib}\undefinedcites
115
\@ifnum{\citetotal>\@tempcnta}%
120
\expandafter\@ifnotrelax\csname bib#1\endcsname{%
124
\advance\@tempcntb\@ne
125
\addit{#1}{\bf Out of order}%
128
\addit{#1}{\bf Undefined}%
132
\def\table@line#1#2{%
135
\hbox to.5\hsize{\ #1\hss}%
137
\hbox to.5\hsize{\ #2\hss}%
144
\appdef\ordertable{\table@line{#1}{#2}}%
149
\@ifnum{\citetotal>\@tempcnta}{%
151
\advance\@tempcnta\@ne
152
\expandafter\addit@bad\csname cite@num\the\@tempcnta\expandafter\endcsname\csname bib@num\the\@tempcnta\endcsname
153
\@ifnum{\citetotal>\@tempcnta}%
156
\expandafter\def\expandafter\citesdisordered\expandafter{\the\@tempcntb}%
158
Analysis of \filename.aux, according to rules of \emph{Physical Review}:
159
All bibitems must occur in the bibliography in order of their first citation in the
160
file, and all bibitems must be cited in the paper.
162
\def\@tempa{\textbf{Bibitems that were not explicitly cited:} }%
163
\@ifx@empty\uncitedbibs{%
164
\appdef\@tempa{none.}%
166
\appdef\@tempa{\uncitedbibs\ \@cite@star@sw{were implicitly cited.}{please cite or remove bibitem(s).}}%
168
\@tempa\expandafter\typeout\expandafter{\@tempa}\par
170
\def\@tempa{\textbf{Citations not defined in bibliography:} }%
171
\@ifx@empty\undefinedcites{%
172
\appdef\@tempa{none.}%
174
\appdef\@tempa{\undefinedcites\space please add bibitem(s) or remove cite(s).}%
176
\@tempa\expandafter\typeout\expandafter{\@tempa}\par
178
\@ifnum{\citesdisordered=\z@}{%
179
\def\@tempa{\textbf{The order of the bibitems is OK.}}%
180
\@tempa\expandafter\typeout\expandafter{\@tempa}\par
184
\@ifnum{\citesdisordered<\tw@}{was an error}{were \citesdisordered\ errors}
185
in the order of your bibitems.}%
187
\@tempa\expandafter\typeout\expandafter{\@tempa}
188
\@ifx@empty\uncitedbibs{\@ifx@empty\undefinedcites{\true@sw}{\false@sw}}{\false@sw}%
189
{(This is in addition to the problems noted above.) }{}%
190
Please check the following table to see what the problems were.
191
Status in boldface signifies that a correction is needed. \par
194
This table is a complete listing of all your citations, in order of their first occurrence:
195
your bibitems should be in the order shown in the first column of this table.
200
\table@line{\textbf{Citation key}}{\textbf{Status}}%
205
% ****** End of file reftest.tex ******