• Aucun résultat trouvé

RUNNING HEADINGS AND FOOTINGS

Dans le document Program Product (Page 77-83)

The .RH [Running Heading] and .RF [Running Footing] control words provide a flexible mechanism for placing information at the top and bottom of each page. Running headings and footings appear inside of, and flush with, the body of the page. Running headings and footings can contain both text and control words, enabling you to format the information to fit your needs. For example, to cen-ter text at the top of each page, you can speci fy

.rh on

.ce Internal Use Only .sp 2

.rh off

You can also emphasize the security classification of your docu-ment by specifying: 16

.rh on .bf GB12

.ce Confidential .sp 2

.rh off

which places the running heading in a bold font.

Separate running headings and footings can be defined for odd- and even-numbered pages. For example, specifying

.rf even .sp 2

.sx c /Page &/Introduction//

.rf off .rf odd .sp 2

.sx c //Introduction/Page &/

.rf off

centers the title "Introduction" at the bottom of each page and places the page number in the lower left corner on even-numbered pages and in the lower right corner on odd-numbered pages. The page number symbol, by default the ampersand (&), is replaced by the current page number whenever it appears in a running heading or footing definition. The .DC [Define Character] PS control word may be used to change the page number symbol.

Because running heading and footing definitions can contain both text and control words, sophisticated headings and footings can be created to fill special requirements. For example, 17

.rh on .bx 1 &$ll .fo center .bf GB12

Expiration Date:

.pf

.us 12 September 1982 .bx off

.sp 2 .rh off

will result in the following running heading being placed at the top of each page:

Expiration Date:

12 September 1982

Running headings and footings appear in the body of a page flush with the text. Ordinarily, some space is included at the end of a running heading and at the beginning of a running footing to sepa-rate the heading or footing from the body text. There may be times, however, when you want to merge a running heading or foot-ing with the body text. For example, the headfoot-ing of a mu1tipage table might be defined as

16 It is not necessary to restore the previous font after the .RH [Running Heading] defini tion because the active formatting environment is automatically saved when a running heading or footing definition is formatted and restored afterward. See

"Chapter 9. The SCRIPT/VS Formatting Environment" on page 109 for details.

17 The .BX [Box] control word is described (n detail under "Draw-ing Boxes" on page 101.

Chapter 4. Defining a Page layout 59

·rh on .bx 1 &$ll .ce Parts list .tb 3 26 53 .bx 1 14 50 &$ll

&$TAB.Part No. &$TAB.Description &$TAB.Quantity .bx .sp

.bx can .rh off

which would produce this heading:

Parts list

Part No. Description Quantity

The vertical rules of this heading can be made to line up and merge with the vertical rules in the body text on each page.

Running heading and footing defini tions must be redefined in their entirety when changed. If a running heading or running foot-ing is no longer needed, it can be completely removed by specify-ing

.rf cancel

If there is an occasion where you do not want to remove a running heading or footing, but you do not want it to be placed on a par-ticular page or series of pages, you can temporarily suppress it by specifying

.rh sup

Then, when you are ready to restore it, all you have to specify is .rh res

This automatically restores the running heading without having to redefine it.

Running headings and footings are processed in two distinct and separate phases:

• Definition phase, where the running heading or running foot-ing definition is processed, symbol substitution (except page number symbol substitution) is performed, and some control words are executed. l s All control words that are not executed and all text lines are saved in input form until SCRIPT/VS performs the formatting phase.

• Formatting phase, where the data saved during the definition phase is reprocessed: all remaining control words are exe-cuted, page number symbol substitution is performed, and all of the text lines are formatted. SCRIPT/VS saves the active environment before this processing begins and then restores it when this processing has been completed.

For example, if your document contains the running footing defi-nition:

.rf on .sp 2 .of 3

.sx f /&title.//Page

&/

.rf off

18 The control words that are executed during the defini tion phase are listed in Figure 28 on page 355.

the value of the symbol &title will be substituted during the definition phase;19 the saved .SX [Split Text] control word will contain no symbols other than the page number symbol and the run-ning footing will be the same on all pages. However, if the symbol

&title is changed periodically throughout your document, such as on chapter boundaries, you may want to define the running footing as:

.su off .rf on .sp 2 .of 3

.ec .su .sx f /&title.//Page &/

.rf off .su on

In this definition, the .SU [Substitute Symbol]

OFF

control word is immediately executed during the definition phase, causing the symbol &title to be saved as part of the data to be processed dur-ing the formattdur-ing phase. 20 You may change the value of the symbol

&title, and thus the running footing, without having to constant-ly redefine the running footing.

Since the formatting phase is normally performed with substi'"

tution off, you must include the .SU control word as part of the definition to explicitly perform symbol substitution during the formatting phase. To prevent this control word from being exe-cuted during the definition phase, you must "execute" i t with the

.EC [Execute Control] control word, which delays the execution of this control word until the formatting phase is performed.

TOP AND BOTTOM RUNNING TITLES

In addition to running headings and footings, you can use the .RT [Running Title] control word to specify running titles. 21 Run-ning titles can include such things as page numbers, chapter or section headings, document titles, or form numbers.

Running top titles appear in the heading space (part of the top margin); running bottom titles appear in the footing space (part of the bottom margin). Each title consists of three parts, sepa-rated by arbitrary delimiters: 22

19

20

21

22

.rt top /left part/center part/right part/

The left part is flush left (aligned with the left margin).

The center part is centered between margins.

The right part is flush right (aligned with the right margin of the page).

The page number symbol will not, however, be substituted.

Page number substitution is performed during the formatting phase.

Substi tution must be explici tly turned on again after the running footing definition; the active formatting environment is saved and restored around the formatting phase, not the definition phase.

Unless you speci fy otherwise, SCRIPT /VS provides a defaul t top title that prints the page number in the upper right cor-ner of the output page.

The delimi ter can be any character that does not appear in the title. SCRIPT/VS assumes that the first nonblank, nonnumeric character that follows "bottom", "top", "even", or "odd" is the delimiter.

Chapter 4. Defining a Page layout 61

For example, to center the words "First Draft" at the top of each page, speci fy

.rt top //First Draft//

SCRIPT/VS replaces the page number symbol, which by default is an ampersand (&), wi th the current page number whenever it appears in a running title. To include the page number in the upper righthand corner of each page, speci fy

.rt top //First Draft/Page &/

When the character ampersand (&) appears as part of the ti tIe, the .DC [Define Character] control word can be used to designate another character as the page number symbol. For example, if

.dc ps ¢

.rt bottom /Reference & User's Guide//Page ¢/

is specified, SCRIPT/VS will automatically place the page number where the

"¢"

appears in the title.

You can specify different titles on odd- and even-numbered pages by using the ODD and EVEN parameters of the .RT [Running Title]

control word. For example, specifying .rt odd bottom //-&-/First Draft/

.rt even bottom /Window Operator's Manual/-&-//

results in the words "First Draft" appearing on the lower right of each odd-numbered output page and the words "Window Operator IS

Manual" appearing on the lower left of each even-numbered output page.

You can specify up to twelve running title lines at one time; six lines of titles for even-numbered pages and six lines of titles for odd-numbered pages.

The .RT [Running Title] control word allows you to specify the order in which you want the lines printed. For top titles, you can number the lines 1 through 6 as you want them to appear at the top of the page. For example, specifying

.rt top 1 //Top title line 1//

.rt top 2 //Top title line 2//

.rt top 6 //Top title line 6//

results in top titles being saved for the top margin as follows:

Top title line 1 Top title line 2 Top title line 6

For bottom titles, you number the lines 1 through 6 starting with the last line of the title. Thus specifying

.rt bottom 1 //Bottom title line 1//

.rt bottom 2 //Bottom title line 2//

.rt bottom 6 //Bottom title line 6//

results in the following bottom titles being saved:

Bottom title line 6 Bottom title line 2 Bottom title line 1

Note:

All running titles are printed in the initial font.

Allocating Space for Running Titles

The default top and bottom margins, listed in Figure 31 on page 357, are defined to allow one line each for running top and bottom titles (heading and footing space), and two blank lines between the running titles and the body of the page (heading and footing margin). Therefore, when you want to use multiline titles, you must be sure to allocate enough space for them.

Use the the .HS [Heading Space] and .FS [Footing Space] control words to speci fy how much addi tional space you want for the titles. However, when specifying space for multiline titles, yo~

should note that:

• The heading margin plus the heading space cannot exceed the amount of vertical space speci fied for the top margin.

• The footing margin plus the footing space cannot exceed the amount of vertical space specified for the bottom margin.

• You can specify from 1 to 6 lines for both the footing space and the heading space, but you can have no more than 6 unique title lines.

For example, if you speci fy the following top and heading margins, .tm 8

.hm 4

your heading space can not be greater than 4. If you specify .hs 3

you have allocated three lines for your top title. The extra line in the top margin will be left blank and will appear above the first line of the title.

Note: If you specify six top title lines, and you specify heading and footing spaces of six, all six title lines will be printed at

the top and the bottom of the page.

WHERE TO DEFINE HEADINGS, FOOTINGS, AND RUNNING TITLES

SCRIPT/VS formats running headings, running footings, and running titles for each page before processing the body text for that page. Therefore, when you redefine a running heading, footing, or title, you should make sure that it is redefined before a control word that causes a new page is encountered, since it will not take effect until the next output page is processed. If it is necessary for SCRIPT/VS to finish processing the current page before a run-ning heading, footing, or title is redefined, you can specify

. pa nostart

which prevents the next page from starting. You can then redefine the running heading, footing, or title for the next page. The next page will automatically be started when text for the body of that page is formatted.

Ordinarily, running headings, footings, and titles do not appear on the first page of a document. If you want them to, you must issue their definitions before any text for the body of the first page is formatted.

Chapter 4. Defining a Page layout 63

Dans le document Program Product (Page 77-83)