[tex-eplain] Indexing and how to determine file dependencies

john@wexfordpress.net john@wexfordpress.net
20 Feb 2001 06:38:47 -0800


On Mon, 19 February 2001, Guy Worthington wrote:


>
> 
> What wrong assumptions have I made about how the toc and index files
> are generated?
> 

Your incorrect assumption is that the make program has a useful function to perform in the index creation process. IMHO it does not. It is possible of course to utilize it (one of Culleton's rules is that "it is possible to do almost anything with almost any software package") 
but nothing is accomplished that can not be done with a simple script. 

I do indexing using eplain and makeindex. My largest index has about 6,000 entries. I ran my little script to perform the three index creation steps described below then convert the results to a ps file and display the ps file on the console. There are three separate indexes involved. My run  takes just 28 seconds. This is very much different from a compile of a large C program where many minutes or even hours may be required. 

Index creation takes three steps:
!. The raw index must be created by some process.
2. The raw index is sorted and condensed into a (semi) finished index by makeindex.
3. The output of makeindex is used in some way to create a typeset document.

The typical  process involving eplain uses in combination tex/plain.tex/eplain.tex for the first and third steps. So the sequence is

1. tex foo.tex
2. makeindex -o foo.ind
3. tex foo.tex

The useful function of the first tex pass is just the creation of the raw index, the third step typesets the document and includes the index as part of that step. 

The TOC generation process is similar except there is no need for the second step.   

The TeX typesetting system is essentially monolithic. There is no equivalent to linking previously compiled modules into a finished product. Everything must be redone from scratch at every pass. So the change detection features of make are not useful. 

If there is any change at all in the output of step 1 then the other two steps must be run also. So any change in the source document that changes pagination or adds/subtracts index items requires repetition of the entire process which is mercifully brief. A script is what is needed.

Steps 1 and 3 do not require TeX etc. A raw foo.idx file can be created in a text editor. And the output of step 2 can be used in some other manner than incorporating it in a tex pass. I am working on a project now where the output will be "flowed" into Quark Xpress by a typesetter. So I will play with the parameters in the foo.ist file to create a file of index items properly indented etc. Then I will import that foo.ind file into AbiWord and export an rtf file. TeX is being used in the first step just for the convenience of embedded indexing.  
.   
I cannot think of an indexing situation where make would be helpful. The TeX process varies too much from the program module compilation & linking model assumed by make. Perhaps Guy has a situation in mind where the make program would add value and can explain that situation to us. 

John Culleton




Please visit http://wexfordpress.com
Typesetting and indexing services. Your sample chapter 
indexed & typeset free!
Personal page is http://wexfordpress.com/john.html