summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ltxmisc/bibcheck.sty
blob: bc7c2bbdc7cb74ad279f7c3beaabe919d7d40973 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
%
% bibcheck.sty 
%
% Copyright (c) 2001, Radhakrishnan CV <cvr@river-valley.com>
%                     Rajagopal CV <cvr3@river-valley.com>
%                     http://www.river-valley.com
%
% River Valley Technologies, Cotton Hills
% Trivandrum, India 695034
%
% Tel: +91 471 233 7501
%
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation; either version 2
% of the License, or (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
% 
% You should have received a copy of the GNU General Public License
% along with this program (gpl.txt); if not, write to the Free
% Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
% MA  02111-1307, USA.
%
% $Id: gpl,v 1.1 2001/02/07 11:30:43 cvr Exp $
%
\NeedsTeXFormat{LaTeX2e}
\def\Fileversion$#1: #2 ${\gdef\fileversion{#2}}
\def\Filedate$#1: #2 #3 ${\gdef\filedate{#2}}
\Fileversion$Revision: 1.1 $
\Filedate$Date: 2001/02/07 11:30:43 $
\ProvidesPackage{bibcheck}
   [\filedate\space\fileversion\space check uncited bibitems (CVR)]
\PackageWarningNoLine{bibcheck}
   {****************************************\MessageBreak
    Package bibcheck v,\fileversion\space loaded\MessageBreak
    [check uncited bibitems (CVR)]\MessageBreak
    ****************************************}

\newwrite\uncitedwrite
\immediate\openout\uncitedwrite=\jobname.uncited
\def\definecitelabel#1{\expandafter\gdef\csname CVRBIB#1\endcsname{1}}
\def\@checkbiblabel#1{%
    \expandafter\ifx\csname CVRBIB#1\endcsname\relax
    \typeout{*******************************************************}
    \typeout{This bibitem [\Xbiblabel] with KEY [#1] is NOT CITED}
    \typeout{*******************************************************}
    \immediate\write\uncitedwrite{Bibitem [\Xbiblabel] with key [#1] not cited}
    \immediate\write\uncitedwrite{}
    \else \relax
%   \typeout{**********************************************************}
%   \typeout{This bibitem with LABEL [#1] is cited in the body text}
%   \typeout{**********************************************************}
  \fi} 

\def\@citex[#1]#2{%
  \let\@citea\@empty
  \@cite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{,\penalty\@m\ }%
     \definecitelabel{\@citeb}%
     \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
     \@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}%
       \G@refundefinedtrue
       \@latex@warning
         {Citation `\@citeb' on page \thepage \space undefined}}%
       {\hbox{\csname b@\@citeb\endcsname}}}}{#1}}

\def\@lbibitem[#1]#2{\item[\@biblabel{#1}\hfill]\if@filesw
      {\def\Xbiblabel{#1}\@checkbiblabel{#2}%
       \let\protect\noexpand
       \immediate
       \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
\def\@bibitem#1{\item\if@filesw
         \def\Xbiblabel{\the\value{\@listctr}}%
         \@checkbiblabel{#1}%
         \immediate\write\@auxout
       {\string\bibcite{#1}{\the\value{\@listctr}}}\fi\ignorespaces}

\endinput

%%
%% End of package bibcheck.sty
%%