summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/amscls/amsmidx.sty
blob: 37752d64d9d5445a952632213feb6bdf26bf10ac (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
%%
%% This is file `amsmidx.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% amsmidx.dtx 
%% 
%%% ====================================================================
%%% @LaTeX-file{
%%%   filename  = "amsmidx.dtx",
%%%   version   = "2.02",
%%%   date      = "2007/09/25",
%%%   time      = "10:22:40 EDT",
%%%   checksum  = "48989 241 948 8314",
%%%   author    = "American Mathematical Society",
%%%   copyright = "Copyright 1995, 2004 American Mathematical Society,
%%%                all rights reserved.  Copying of this file is
%%%                authorized only if either:
%%%                (1) you make absolutely no changes to your copy,
%%%                including name; OR
%%%                (2) if you do make changes, you first rename it
%%%                to some other name.",
%%%   address   = "American Mathematical Society,
%%%                Technical Support,
%%%                Publications Technical Group,
%%%                201 Charles Street,
%%%                Providence, RI 02904,
%%%                USA",
%%%   telephone = "401-455-4080 or (in the USA and Canada)
%%%                800-321-4AMS (321-4267)",
%%%   FAX       = "401-331-3842",
%%%   email     = "tech-support@ams.org (Internet)",
%%%   codetable = "ISO/ASCII",
%%%   keywords  = "latex, amslatex, multiple indexes",
%%%   supported = "yes",
%%%   abstract  = "This is part of the AMS-\LaTeX{} distribution.
%%%                It contains code to support the creation and
%%%                typesetting of multiple indexes with AMS-LaTeX{}
%%%                document classes, superseding the single-index
%%%                facilities built into those document classes.
%%%                It also provides a facility to insert a paragraph
%%%                of comments between the title and the index proper",
%%%   docstring = "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.",
%%% }
%%% ====================================================================
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesPackage{amsmidx}[2007/09/25 v2.02 multiple indexes for AMS classes]
\renewcommand{\makeindex}[1]{%
  \begingroup
    \makeatletter
    \if@filesw \expandafter\newwrite\csname #1@idxfile\endcsname
    \expandafter\immediate\openout \csname #1@idxfile\endcsname #1.idx\relax
    \typeout{Writing index file #1.idx }\fi
  \endgroup}
\renewcommand{\index}[1]{%
  \@bsphack
  \begingroup
    \def\protect##1{\string##1\space}\@sanitize\@wrindex{#1}}
\renewcommand{\@wrindex}[2]{%
  \let\thepage\relax
  \xdef\@gtempa{%
    \@ifundefined{#1@idxfile}{%
      \PackageError{\@packagename}{%
        The requested file, #1@idxfile.idx, does not exist;\MessageBreak
        index term #2 will not be be written out.%
      }%
    }{%
      \expandafter\write\csname #1@idxfile\endcsname
        {\string\indexentry{#2}{\thepage}}%
      }%
    }%
  \endgroup\@gtempa
  \if@nobreak \ifvmode\nobreak\fi\fi
  \@esphack
  }
\renewcommand{\printindex}[1]{\@input{#1.ind}}
\newcommand{\Printindex}[2]{%
  \begingroup
    \cleardoublepage
    \def\indexname{#2}%
    \raggedright
    \hyphenpenalty=10000
    \renewcommand{\seename}{see~also}
    \renewcommand{\subitem}{\par\hangindent 3em\hspace*{1em}}
    \@input{#1.ind}%
  \endgroup
  }
\newdimen\@indexcommentwidth
\@indexcommentwidth=\textwidth
\ifdim\@indexcommentwidth > 26pc
  \advance\@indexcommentwidth-6pc
\else
  \advance\@indexcommentwidth-4pc
\fi
\newcommand{\indexcomment}[1]{%
  \def\theindexcomment{%
    \vskip\baselineskip
    \parbox[t]{\@indexcommentwidth}{\normalsize\mdseries#1}%
    }%
  }
\let\theindexcomment\@empty
\renewcommand{\indexchap}[1]{%
  \global\topskip 7.5pc\relax
  \twocolumn[\fontsize{\@xivpt}{18}%
    \vskip\topskip\vskip-\baselineskip\hbox{}% adjust top space
    \bfseries\centering #1\par
    \ifx\theindexcomment\@empty
    \else \theindexcomment
      \global\let\theindexcomment\@empty
    \fi
    ]%
  \global\topskip 34\p@
}
\endinput
%%
%% End of file `amsmidx.sty'.