summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/index/autind.sty
blob: 5e433831aff7ce3a118ed351ec533d86413bec81 (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
%%% ====================================================================
%%%  @LaTeX-style-file{
%%%     filename        = "autind.sty",
%%%     version         = "1.0beta",
%%%     date            = "28 September 1995",
%%%     time            = "23:00:49 EDT",
%%%     author          = "David M. Jones",
%%%     address         = "MIT Laboratory for Computer Science
%%%                        Room NE43-316
%%%                        545 Technology Square
%%%                        Cambridge, MA 02139
%%%                        USA",
%%%     telephone       = "(617) 253-5936",
%%%     FAX             = "(617) 253-3480",
%%%     checksum        = "41079 80 198 2750",
%%%     email           = "dmjones@theory.lcs.mit.edu",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "",
%%%     supported       = "yes",
%%%     abstract        = "",
%%%     docstring       = "See autind.tex for documentation.
%%%
%%%                        The checksum field above contains a CRC-16
%%%                        checksum as the first value, followed by the
%%%                        equivalent of the standard UNIX wc (word
%%%                        count) utility output of lines, words, and
%%%                        characters.  This is produced by Robert
%%%                        Solovay's checksum utility.",
%%%  }
%%% ====================================================================

\def\authorindextag{aut}

\def\authorindex@cite#1{%
    \begingroup
        \def\do{\index[\authorindextag]}%
        \@for\@tempa:=#1\do{%
            \csname b@autind@\@tempa\endcsname
        }%
    \endgroup
}

\def\authorindexentries#1#2{%
    \if@filesw
        \def\@tempa{#2}%
        \edef\@tempa{%
            \write\@auxout{%
                \string\bibcite{autind@#1}{\@nearverbatim\@tempa}%
            }%
        }%
        \@tempa
    \fi
    \begingroup
        \def\do{\index[\authorindextag]}%
        #2%
    \endgroup
}

\def\adjustcitation#1{%
    \edef\@tempa{\string#1}%
    \edef\@tempb{%
        \let\expandafter\noexpand\csname ord@\@tempa\endcsname\noexpand#1%
        \def\noexpand#1{%
            \noexpand\@ifnextchar [
                {\expandafter\noexpand\csname a@\@tempa\endcsname}
                {\expandafter\noexpand\csname b@\@tempa\endcsname}%
        }%
        \def\expandafter\noexpand\csname a@\@tempa\endcsname[####1]####2{%
            \noexpand\authorindex@cite{####2}%
            \expandafter\noexpand\csname ord@\@tempa\endcsname[####1]{####2}%
        }%
        \def\expandafter\noexpand\csname b@\@tempa\endcsname ####1{%
            \noexpand\authorindex@cite{####1}%
            \expandafter\noexpand\csname ord@\@tempa\endcsname{####1}%
        }%
    }%
    \@tempb
}

\endinput