summaryrefslogtreecommitdiff
path: root/obsolete/macros/latex209/contrib/vdm/vdmindex.sty
blob: c3df2f7a8cced30308248c36f4e811b48ece5638 (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
%%% ====================================================================
%%%  @LaTeX-style-file{
%%%     author          = "Mario Wolczko",
%%%     version         = "2",
%%%     date            = "21 May 1992",
%%%     time            = "21:10:02 BST",
%%%     filename        = "vdmindex.sty",
%%%     address         = "Dept of Computer Science
%%%                        The University of Manchester
%%%                        Oxford Road
%%%                        Manchester M13 9PL
%%%                        UK",
%%%     telephone       = "+44-61-275-6146",
%%%     FAX             = "+44-61-275-6236",
%%%     checksum        = "16947 78 289 2980",
%%%     email           = "mario@madarch (Internet)",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "LaTeX, VDM specification language, indexing",
%%%     supported       = "yes",
%%%     docstring       = "Modifies the behaviour of the VDM style to
%%%     facilitate indexing of types, functions and operations.",
%%%  }
%%% ====================================================================
%
% The makeidx and ifthen styles must also be included in the style options when
% using this style, eg:
%	\documentstyle[vdm,makeidx,ifthen,vdmindex,12pt...
%	\makeindex
% See the makeindex manual for more detail on how indexing works.
%
% Under normal use, an index of all \type, {record}, {fn} and {op}
% names will be written to a .idx file.  After this is done, the shell
% script vdmindex should be run, generating typeidx.ind and fnidx.ind,
% which are then subsequently included using \include, eg:
%  \section{Index to Types}
%  \input{typeidx.ind}
%
%  \section{Index to Functions}
%  \input{fnidx.ind}
%
% Any type, record, function or operation can be excluded from the
% index by placing the command \noindex within the environment (or
% before, for \type).
%
{\makeatother\global\let\atletter@}

% stuff to index names
\newcommand{\@doindex}{yes}
\def\noindex{\gdef\@doindex{no}}
\def\doindex{\gdef\@doindex{yes}}

\def\postOperationHook{%
  \ifthenelse{\equal{\@doindex}{yes}}%
	{\index{op-\the\@operationName\atletter$\the\@operationName$}}%
	{\doindex}%
  \penalty\postOperationPenalty}
\def\postFunctionHook{%
  \ifthenelse{\equal{\@doindex}{yes}}%
	{\index{fn-\the\@fnName\atletter$\the\@fnName$}}%
	{\doindex}%
  \penalty\postFunctionPenalty}
\def\postTypeHook{\ifthenelse{\equal{\@doindex}{yes}}%
	{\index{type-\the\@typeName\atletter$\the\@typeName$}}%
	{\doindex}}
\def\postRecordHook{%
  \ifthenelse{\equal{\@doindex}{yes}}%
	{\index{rec-\the\@recordName\atletter$\the\@recordName$}}%
	{\doindex}%
  \penalty\postRecordPenalty}

% this overrides LaTeX's theindex env, which generates "Index"
% and goes into two column mode.
\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
%\columnseprule \z@
%\columnsep 35pt%\twocolumn[\@makeschapterhead{Index}]
%    \@mkboth{INDEX}{INDEX}\thispagestyle{plain}
    \parindent\z@
    \parskip\z@ plus .3pt\relax\let\item\@idxitem}