• Aucun résultat trouvé

Developing Preprocessor APFs and Profiles

Dans le document Program Product (Page 186-190)

SCRIPT/VS has a great variety of general document-handling func-tions which can be used independently of formatting. You can use these functions to create APFs that will translate a SCRIPT/VS document into suitable input for another program, such as a for-matter that can support photocomposers.

47 See "Chapter 14. GMl Support in SCRIPT/VS" on page 159 for details about profiles, APFs, and mapping tags to APFs. See

"Chapter 12. Symbols in Your Document" on page 129 for details about symbols, and "Chapter 13. Wri ting SCRIPT /VS Macro

Instructions" on page 147 for details about macros.

Chapter 15. Using SCRIPT/VS with Other Programs 167

For exampl~, the GML starter set APFs for ordered lists and list items automatically generate numbers (or letters) for the items on an ordered list. This is convenient,. since it permits the list to be revised without renumbering all the items.

You can create a modified version of the APFs which retain the general processing functions, but eliminate the SCRIPT/VS control words that result in formatting. For example, instead of execut-ing the . SK [Skip] and . IN [Indent] control words, you would insert the appropriate formatting controls of the postprocessor into the output stream. The SCRIPT/VS symbol substitution

capa-~ility can still be used to calculate parameters for the postprocessor's formatting controls.

Some of the logical sequence of formatting controls might have to be changed, however. The graphic effect of having the first line of a list item printed to the left of the indention for the rest of the list item is achieved, in SCRIPT/VS, with the .IN [Indent]

control word. The receiving processor might require a different sequence of formatting controls to achieve the same graphic

effect.

When modi fying an AP"F in this way, you can structure its logic and function to produce formatting di fferent from that produced by the original APF. You can change the symbol definition for symbols used to achieve different formatting values.

In addition to creating APFs, you would also create a profile which would map to the new APFs. The profile would also issue con-trol words that would turn off justifi~ation and page numbering, and the like, so the output would look like a source file .

. pm 0 .tm 0 .bm 0 .wz off .fo off

You might also need to translate special characters which might be unacceptable to the postprocessor.

By having two sets of APFs and two profiles, you could continue to print draft copies of the document on a line printer while getting final output on a photocomposer via the postprocessor.

Rede~in1ng Symbols

Many symbols used in source document markup will not require redefinition. For example, those used:

• As abbreviations for lengthy character strings

• As references to generated information which is not format-dependent (such as a figure or section number but not a page number)

• To enter unkeyable characters which are represented by the same codes in both SCRIPT/VS and the postprocessor

Handling Directly Entered Control Nards

Observing a GML convention for direct entry of control words, like that described in the Document Composition Facility Generalized Markup Language: Starter Set Reference, makes it easy to prepare your document for another processor. The following discussion refers to the specific conventions recommended in that book, but the information is applicable to conventions that may be adopted by your own installation.

Managing a Source Document

The .CM [Comment], .IM [Imbed], and .SE [Set Symbol] control words are executed by SCRIPT/VS before the document is available to the postprocessor. You need take no special action with respect to them.

However, the .RC [Revision Code] and .OC [Output Comment] control words are different; they have a formatting effect. (The .RC con-trol word inserts a revision code character to the left of an out-put line; the .OC control word places unformatted outout-put comments at the same position in the output as they were encountered in the input.) If the postprocessor has comparable functions, you can define macros, called .RC and .OC, to generate the corresponding postprocessor controls. (This technique can be used for all con-trol words i f a one-to-one conversion approach is taken.)

If the "revision code" and/or "output comment" functions are hot available, you can deactivate them by specifying

.dm rc /.cm and/or

.dm oc /.cm

which defines the .RC and/or .OC macros to be comments.

Preparing for Processing

When you are ready to have SCRIPT/VS prepare your input file for the receiving text processor 1 take the usual steps needed for SCRIPT/VS execution, as discussed in "Chapter 2. Using the SCRIPT Command" on page 13.

While the file produced by SCRIPT/VS will contain the correct text and markup for your postprocessor, i t will not necessarily have the correct physical characteristics. Some postprocessors may require record lengths and formats, or other characteristics, that differ from those produced by SCRIPT/VS. You might have to use a utility program, or code your own, to handle such interface requirements.

Chapter 15. Using SCRIPT/VS with Other Programs 169

HYPHENATION

CHAPTER 16. AUTOMATIC HYPHENATION AND SPELLING VERIFICATION

SCRIPT/VS can automatically hyphenate and verify the spelling of words. When these functions are activated, words that occur at the end of an output line will automatically be hyphenated if needed, and each word in your document will be checked for correct spell-ing. The SCRIPT/VS dictionaries, described later in this chapter, are used for both hyphenating words and for spelling verification.

During formatting, if hyphenation is enabled and the next word does not fit in the current line, SCRIPT/VS tries to hyphenate the word using the method you have specified with the .HY [Hyphenate]

control. You can instruct SCRIPT/VS to:

• Search a SCRIPT/VS dictionary to see if there is an entry for the word to be hyphenated

and/or

• Use an algorithmic hyphenator to hyphenate the word.

Unless otherwise specified, SCRIPT/VS will first search for the word in the main and addenda dictionaries that make up the SCRIPT /VS dictionary being used. If the word cannot be found there, i t will use an algorithmic hyphenator to perform the hyphenation. If you do not want the addenda dictionary searched, you specify

.hy noadd

If you do not want any of the dictionaries to be searched, you specify

.hy nodict

If you do not want the avai lable algori thmic hyphenator to be used, you specify

.hy noalg

You can also use the .HW [Hyphenate Word] control word to provide SCRIPT/VS with the hyphenation points for a specific word.

Hyphenation specified using the .HW [Hyphenate Word] control word takes precedence over any other hyphenation method that is in effect, but affects only that specific instance of the word.

Dans le document Program Product (Page 186-190)