summaryrefslogtreecommitdiff
path: root/obsolete/support/windex/windex.tex
blob: 2374e039e519d9fe78330296fdde83bb36911cc3 (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
% File windex.tex
% Macro for writing out index files (.idx files) for use with windex
% Author: Ronald L. Rivest
% Date:   11/20/89
% Note:   If you are using windex, then this file should be input into
%         your source file before and \index commands are given.
%         (It need not precede the \makeindex command.)
%         At the end of your file foo, you can place the commands
%	  	\makeatletter
%	  	\@input{foo.index}
%         	\makeatother
%         just before the \end{document} command.
%	  (These command are equivalent to 
%               \input{foo.index}
%         unless foo.index doesn't yet exist, in which case \@input
%         merely prints a warning message and procedes, whereas \input
%         asks you for another file name.)

\makeatletter

%% The following causes all indexed terms to be printed in the right-hand 
%% margin of the page.
%% To kill this effect, redefine \indexmargin to be a null macro

%% The following is for debugging (produces marginal index terms)
%% Comment this out for production; leave in for debugging.
%\newcommand{\indexmargin}[1]{{\tiny\marginpar{#1}}} 	
%% The following is for production (no marginal index terms)
%% Comment this out for debugging; leave in for production.
\newcommand{\indexmargin}[1]{}				

\@mparswitchfalse		% Cause all marginal pars to go on right side 

%% End of marginal notes for index terms hack

%% Make all characters ``other'' so that par box doesn't give errors
\def\@makeallother{%
\@makeother a\@makeother n\@makeother A\@makeother N%
\@makeother b\@makeother o\@makeother B\@makeother O%
\@makeother c\@makeother p\@makeother C\@makeother P%
\@makeother d\@makeother q\@makeother D\@makeother Q%
\@makeother e\@makeother r\@makeother E\@makeother R%
\@makeother f\@makeother s\@makeother F\@makeother S%
\@makeother g\@makeother t\@makeother G\@makeother T%
\@makeother h\@makeother u\@makeother H\@makeother U%
\@makeother i\@makeother v\@makeother I\@makeother V%
\@makeother j\@makeother w\@makeother J\@makeother W%
\@makeother k\@makeother x\@makeother K\@makeother X%
\@makeother l\@makeother y\@makeother L\@makeother Y%
\@makeother m\@makeother z\@makeother M\@makeother Z%
\@makeother /\@makeother !\@makeother <\@makeother >%
\@makeother \$\@makeother [\@makeother ]%
%\@makeother\ 
\@makeother\\\@makeother\$\@makeother\&%
\@makeother\#\@makeother\^\@makeother\^^K\@makeother\_\@makeother\^^A%
\@makeother\%\@makeother\~}

\def\index{\@bsphack\begingroup\@makeallother\@wrindex\@indexfile}

%% In the following #1 is the file,#2 is the string being indexed
\def\@wrindex#1#2{\let\thepage\relax
    \indexmargin{\fbox{\parbox[t]{1in}{#2}}}%
    \xdef\@gtempa{\write#1{#2:\thepage}}\endgroup\@gtempa
    \if@nobreak \ifvmode\nobreak\fi\fi\@esphack}

\makeatother