summaryrefslogtreecommitdiff
path: root/indexing/addindex/README
blob: d065834215dfd723cabad95681eea9a53732c104 (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
Q: What is this?
A: This is the first version of addindex.  Bugs, fixes, comments and 
suggestions should be sent to Yossi Gil (yogi@cs.ubc.ca). It has been 
tested on Sun Sparc station only. Modifications for other systems should be
easy. The program is supplied on an as is basis. Use at your own
risk. 

Q: What is it good for?
A: 'addindex' is a  program for adding index entries to LaTeX files.
It is most useful for adding Names (such as Knuth, Donald Ervin) 
index to an existing files.

Q: How to use?
A: There are two steps in using the program:
1) Prepare a names database or use the example database enclosed. 
(instructions for preparing a database are given later)
2) Invoke the program by 
	addindex  file[s]
This will add the \index{} entries to the files named in the command
line. A backup copy of each of files processed will be created.
The old version of krack.tex will be called krack.tex.BAK. 
You can also use addindex as a filter:
	cat myfile.tex | addindex |  more 

Q: Can 'addindex' be used on files which already have index commands?
A: Yes. Further, 'addindex' will make a reasonable effort to avoid
   inserting double index commands, index to commands such as
   \cite{Knu:Gnat:71} etc. When you edit your files keep in mind
	that the index command should follow the  indexed entry
	immediately.	 

Q: What should I know before using the program?
A: All about 'makeindex' and 'latex' programs!

Q: How do I compile the program?
A: If you are on sun sparc station just use make. Season and hack to
taste on others systems. 

Q: How do I prepare the names database? 
A: Start with the enclosed example. The format is quite rigid so don't
mess with it. An entry is in the form:
@string{Knuth = "Knuth, Donald Ervin"}. 
Which when processed by 'addindex' will add an index entry
of "Knuth, Donald Ervin" to any mention of the name Knuth in the
text.

Q: Are duplicate entries in the database permitted?
A: Yes, only the first occurence of each entry is significant.
note that this is different than the operation of BiBTeX.

Q: What name should I use for the names database?
A: The default name is 'names.bib'. You can change this name to
any othe name by setting the environment variable INDEXDB.

Q: Where should I put the names database?
A: Normally, in the current directory. However, 'addindex' will
look for the index in the directories specified in the environment
variables: INDEXINPUTS, BIBINPUTS, TEXINPUTS, PATH.

Q: Examples?
A: A very short example file called is provided. Try running:
a) addindex < example.tex | addindex | addindex | addindex
b) 'addindex example.tex' and then 'diff example.tex example.tex.BAK'
	 
Q: 'addindex' looks like a last moment hack and not like a real
program. Is this true.
A: Yes, 'addindex' was done in a few hours of hacking. Do you care
enough to improve it?

Q: What does the author expect in return for using his program?
A: Not much. If you compile your own names database, please send a
copy to me: yogi@cs.ubc.ca.