• Aucun résultat trouvé

TWOPASS Considerations

Dans le document Program Product (Page 96-100)

If you place the . TC [Table of Contents] control word at the beginning of your input file, you must use the TWOPASS option of the SCRIPT command to produce a complete table of contents. Other-wise, the DSMUTTOC file will be empty when the .TC control word i~

encountered. For details, refer to "TWOPASS: Prepare the Document With Two Formatting Passes" on page 31.

In order to have correct page numbers in the table of contents, pages must be numbered the same way on both passes. On the first pass, the table of contents is empty. On the second pass, i t can contain several pages of information. Because SCRIPT/VS doesn't know how many pages will be required for the table of contents, i t numbers the pages following the table of contents the same way on both passes.

You can tell SCRIPT/VS the number of page numbers to reserve for the table of contents. For example, you can reserve six pages if the table of contents is to occupy pages 3 through 8. The page number range you reserve has nothing to do with how many actual pages the table of contents will occupy: i t only establishes the page number of the page that follows the table of contents page.

For example, if the table of contents will require three pages, you can reserve the current page number and the next two page num-bers by specifying:

.tc 3 Table of Contents

If the document is formatted with the TWOPASS option, SCRIPT/VS will allow page numbering to continue sequentially following the table of contents if the page number is explicitly reset with a

.PA [Page Eject] or .PN [Page Numbering Mode] control word before any head level or . PT [Put Table of Contents] control word is encountered that requires knowledge of the page number.

You can precede the .TC [Table of Contents] control word with oth-er SCRIPT/VS control words:

• To number table of contents pages with roman numerals, use the .PN [Page Numbering Mode] control word:

.pn roman

• To put bottom titles on each tdble of contents page, use the .RT [Running Title] control word:

.rt bottom even /Contents &///

.rt bottom odd ///Contents

&/

• To ensure that the first page of the table of contents starts on an odd-numbered page, use the . PA [Page Ej ect] control word:

.pa odd

Note:

Since the . TC [Table of Contents] control word has a level-one heading built into it, you should never (whether you speci fy one or two formatting passes) put a . DH [Define Head

Level] level one heading before

a

.TC [Table of Contents] entry.

Chapter 6. Head Levels and Table of Contents 77

CHAPTER 7. INDEXING

SCRIPT/VS enables you to automatically produce an index, such as the one contained in this publication. Include the INDEX option when you issue the SCRIPT command to indicate to SCRIPT/VS that an index is to be generated from the information provided by the .PI [Put Index] control words. The .PI [Put Index] control words are used to speci fy the index entries and are placed throughout a doc-ument wherever the index entry topics are described.

This automatically generated index can contain multilevel entries and cross references. SCRIPT/VS will automatically generate the page numbers for the index entries based on the location of .PI control words within the document. For example, specifying

.pi /weasels/

indicates that the term "weasels" should be placed in the index along with a reference to the current page number.

POSITIONING THE INDEX IN A DOCUMENT

Use the .IX [Index] control word to indicate where you want the index to be placed in the document. When SCRIPT/VS encounters this control word, it starts a new page, if it is not already at the top of a page, and prints the word "INDEX" as a heading. If you want a different title, you can include one when you specify the

.IX c~ntrol word. For example, you might specify .ix Subject Index

which indicates that "Subject Index" is to be used for the title instead of "INDEX."

If you do not want any title at all, specify a single slash (/).

For example, specifying .ix /

causes SCRIPT/VS to generate the index without a title.

CREATING INDEX ENTRIES

Page References

The first nonblank character that follows the .PI control word delimits the beginning of an index term; the second occurrence of that character delimits the end of that term. Any nonblank charac-ter that does not appear in the index charac-term can be used as a delim-iter. The trailing delimiter does not have to be specified if no other text follows the index term on the input line. For example, specifying

.pi !SCRIPT/VS

will place the term "SCRIPT/VS" in the index along with a refer-ence to the current page number.

Regardless of the order in which they are spec~ fied wi thin a I docu-ment, all index entries are placed in alphabetical order--before the index is formatted. For example, if you specify

.pi /martens .pi /marsupials

"marsupials" will appear in the index before "martens."

If the same index term is specified several times within a docu-ment, that term will only be included in the index once. The page

Chapter 7. Indexing 79

numbers for each occurrence of that term will be listed after it, separated by commas. For example, several occurrences of the term

"melodrama" wi 11 be formatted in the index as melodrama 9, 14, 37

If one particular instance of an index term is more important than the others, you can use the ORDER parameter of the .PI [Put Index]

control word to indicate that that page reference is to be listed first, regardless of where in the document other references occur. For example, if the second reference to "melodrama" refers to the principal discussion of the subject, and the others are just passing references, the second instance can be specified as

.pi order /melodrama The entry wi 11 be formatted as

melodrama 14, 9, 37

If the discussion of- a topic is lengthy, you can indicate the range of pages the discussion spans. The START and END parameters of the .PI control word can be used to mark the beginning and end of the topic. For example, the principal discussion of

"melodrama" can be preceded by .pi start /melodrama and succeeded by

.pi end /melodrama

The entry wi 11 be formatted as melodrama 9, 14-16, 37 Multilevel Entries

When there are many references to a particular index term, you may want to further qualify the term with another level of indexing.

Up to three levels of terms can be specified for an index entry using the .PI control word. SCRIPT/VS collects all index entries with the same first-level term and sorts the second-level terms alphabetically. These second-level terms are then placed in the index immediately following the first-level term to which they apply. Similarly, all index entries with the same first- and sec-ond-level terms are collected together and formatted alphabetically. These third-level terms are then placed in the index immediately following the second level-term to which they apply. For example, a description of weasels may contain the fol-lowing:

.pi /weasels/training

.pi /weasels/care and feeding .pi /weasels/breeding

The index entry for "weasel" would look like thisl weasels

breeding 22

care and feeding 15 training 14

Simi larly, the section concerned wi th the care and feeding of weasels might contain these entries:

.pi /weasels/care and feeding/exercise .pi /weasels/care and feeding/nutrition .pi /weasels/care and feeding/dental hygiene

The index entry will then appear as weasels

breeding 22

care and feeding 15 dental hygiene 19 exercise 15

nutrition 16 training 14

Dans le document Program Product (Page 96-100)