• Aucun résultat trouvé

CREATING THE INDEX

Dans le document Program Product (Page 103-108)

When you specify the .IX [Index] control word, SCRIPT/VS formats the index by creating and executing . IE [Index Entry] control words for each index entry. The first parameter of the .IE control word indicates the index entry level. For example, the control words

.pi /Pines/Lodgepole .pi /Pines/Japanese Black

will generate the first-level term, "Pines",

second-level terms, "Japanese Black" and "Lodgepole". with two When you specify .IX, SCRIPT/VS will format these terms by creat-ing and executcreat-ing the followcreat-ing control words:z7

Z7 The blank between the control word name and the first parame-ter does not have to be specified, as described in "Chapparame-ter 23. SCRIPT/VS Control Word Descriptions" on page 219. It is omitted in the .IE [Index Entry] control words generated by

.IX [Index].

.IEI Pines

.IE2 Japanese Black 9 .IE2 lodge pole 5

The . IE [Index Entry] control word causes a break and sets an indention based on the first parameter. This makes the formatted entry appear as

Pines

Japanese Black 9 lodge pole 5

The .IX [Index] control word precedes each section of the index with an .IE Header control word. For example7 the "PH header that precedes the section containing terms beginning with UP" is gen-erated using

.IEH P

This header control word causes SCRIPT/VS to skip two lines, print the specified section letter7 and then skip another line before formatting the first index entry for that section.28 The .IX con-trol word generates and executes a header for each section of the index for which there are entries.

28 Since SCRIPT/VS omits the optional blank between the control word name and the first parameter7 you can write macros to provide more elaborate formatting for some index entries without interfering with other terms. For example7 the fol-lowing macro will draw a box around each index header:

.dm ieh / .sk 2 / .bx I 5 / &*/ .bx off / .sk

The formatting of first- 7 second- 7 and third-level entries is not affected by this macro.

Chapter 7. Indexing 85

CHAPTER 8. ADDITIONAL FORMATTING FEATURES OF SCRIPT/VS

In addition to formatting your document as described in previous chapters, SCRIPT/VS allows you to:

• Define character mappings, or translations, to be performed at various times during the processing of input and output

lines

• Establish characters with special meaning for SCRIPT/VS

• Keep blocks of text together so that, on output, the kept-together material appears entirely in one column

• Define footnotes to be placed at the bottom of the page

• Mark all updated material in a review draft, so readers can identify the modified material

• Draw rectangular boxes with horizontal and vertical interior lines

• Treat underscoring and capi talization as fonts, and over-strike text (on impact printers) to produce bold and strikeout text

CHARACTER MANIPULATION

SCRIPT/VS performs several character translations on input and output lines as part of its normal processing. You can define the specific character mappings each of these translations peforms for such purposes as:

e Printing characters that are available on your output device but not on your terminal

• Simulating control characters not available on your terminal

• Pairing the upper- and lowercase letters of various national languages, such as German

e Expanding individual input characters into character strings Output Character Translation

If you are using a terminal with a standard keyboard, you may not have an immediate way to enter special characters in a SCRIPT/VS file. You may not, for example, be able to directly enter a bullet (.) from the keyboard. When you print SCRIPT/VS output, you may want to use a bullet and other special characters as well.

One way to enter special characters into a file is to use appro-priate commands while editing.

SCRIPT /VS provides another method for printing special characters. You can specify that one of your keyboard characters be translated to the special character, using the .TR [Translate Character) control word.z9 For example,

.tr

*

af

Each occurrence of an asterisk in your file is translated, on out-put, to the bullet character ee) which has the hexadecimal code AF. For example, the input line

Z9 Hexadecimal 27 is reserved for internal use by SCRIPT/VS, and should not be used with the .TR [Transla~e Character) control word.

Chapter 8. Additional Formatting Features of SCRIPT/VS 87

*

Pay attention to this point.

results in:

• Pay attention to this point.

"Appendix D. Fonts Supplied wi th SCRIPT /VS" on page 377 and Figure 38 on page 364 illustrate the various character sets available and their hexadecimal codes. You can use these charts when you want to translate characte~s such as:

• Brackets: [ ]

• Braces: { }

Algebraic and logical symbols: < S; #.

=

~ >

... ±

• Superscript numerals: 0 1 2 .3 4 5 6 7 8 9

• B u l l e t s : · ·

Box characters: r , L .J T .L

+

~

i

You can specify as many translation pairs with on~ .TR [Translate Character] control word as your input line allows. For example,

.tr a AC b BC c BB d AB - BF FA

specifies the corners, vertical bar, and dash.3O used for drawing a box. Each special character is specified as its character code:

hexadecimal AC is the code for"

r",

hexadecimal BC is the code for

",", and so on. When the characters "a", "b", "c", "d",

"I",

and

"_n

appear in a subsequent output line, they are replaced wi th the

special characters' hexadecimal codes. For example, the input lines

a---b

I I

I I

I I

d---c result in

D

To cancel translation of all previously specified character map-pings, use the . TR [Translate Character] control word with no parameters:

.tr

When you have many character mappings specified, you can reassign or cancel some of them without affecting the others. For example,

.tr ( (

cancels translation of the left parenthesis to any character established for it. Actually, this is equivalent to setting up a new mapping for "(": the character is to be translated to itself .

.30 When you use hyphens to draw boxes, you can translate them to the extended dash (hexadecimal BF), which aligns with the corner symbols and extends further than a hyphen to create an uninterrupted line. Similarly, the character code FA provides a vertical bar that is longer than the one available on most keyboards which abutts with the corner characters.

Note:

While an output character mapping is in effect, every occurrence of the affected character is translated to the desig-nated output character. You should therefore take care to trans-late only characters that will not be needed during that time.

Output translation is performed during formatting just before the characters' widths are measured for justification.

If you have used the .TR [Translate Character] control word and direct the SCRIPT/VS output to your terminal, some of the special characters may not be displayed in the output. The posi tions occu-pied by the translated characters may appear as blanks, because there are no equivalent characters on the terminal. You can use the .IF [If] control word to make character translations condi-tional based on the output device:

.if SYSOUT eq PRINT .tr

*

af

This control ·word line results in output translation of asterisks (*) only if output is going to the printer. The .IF [If] control word is discussed in detail in "Chapter 10. Conditional Process-ing" on page Ill.

Dans le document Program Product (Page 103-108)