[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 4


ndx Command

Purpose

Creates a subject-page index for a document.

Syntax

ndxSubjectFile ] " FormatterCommandLine "

Description

The ndx command, given a list of subjects (SubjectFile), searches a specified English-language document and writes a subject-page index to standard output.

The document must include formatting directives for the mm, mmt, nroff, or troff commands. The formatter command line informs the ndx command whether the troff command, nroff command, mm command, or mmt command can be used to produce the final version of the document. These commands do the following:

troff or mmt Specifies the troff command as the formatting program.
nroff or mm Specifies the nroff command as the formatting program.

Parameters


SubjectFile Specifies the list of subjects that are included in the index. Each subject must begin on a new line and have the following format:

word1[word2...][,wordk...]

For example:

printed circuit boards
arrays
arrays, dynamic storage
Smith, W.P.
printed circuit boards, channel-oriented
                               multi-layer
Aranoff
University of Illinois
PL/1

The subject must start in column one.

FormatterCommandLine Creates the final form of the document. The syntax for this parameter is as follows:

Formatter [Flag...File...

mm -Tlp File(s)
nroff -mm -Tlp -rW60 File(s)
troff -rB2 -Tibm3816 -r01.5i File(s)

For more information on the formatter command line, see the mm command, mmt command, nroff command, and troff command.

The flags specified by the Flag variable are those that are given to the troff, nroff, mm, or mmt command in printing the final form of the document. These flags are necessary to determine the correct page numbers for subjects as they are located in the document. The ndx command does not cause the final version of the document to be printed. The author must create the document separately. Use the indexer only after the document is complete and cannot undergo further changes.

Examples

  1. The following command produces a subject-page index for the file document and takes its subjects from the subfile list:

    ndx subfile "nroff -mm -rW70 file" > indexfile
    

    The page numbers correspond to the document produced by:

    nroff -mm -rW70 file 
    
  2. The following command produces a subject-page index for the documents ch1, ch2, and ch3:

    ndx subfile "mm -rW60 -rN2 -rO0 ch1 ch2 ch3" > indexfile
    

    The page numbers would correspond to the documents produced by:

    mm -rW60 -rN2 -rO0 ch1 ch2 ch3
    
  3. The following command produces a subject-page index for the document file:

    ndx Subjfile "troff -rB2 -rW5i -rO1.5i -mm file" > indexfile
    

    The page numbers correspond to the document produced by entering:

    troff -rB2 -rW5i -rO1.5i -mm file
    

Related Information

The mm command, mmt command, nroff command, subj command, troff command.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]