Every template consists of two main parts:
1.
|
Initiation section—Contains declarations and statements that pertain to the overall template. It may not include output statements.
|
2.
|
Template segments—Sections of the program, each of which pertains to a particular portion of the document.
|
Template segments are the basic divisions of the document and, when executed, produce distinct output files called document segments; these are later assembled into the final document. The segments do not necessarily correspond to the document divisions (i.e. chapters, sections, etc.). However, we recommend that you divide the segments according to such divisions. This gives you the ability to generate separate sections or chapters individually; the initiation section, however, is executed whenever any segment is executed. See the discussion on Template Sections for more information.
The initiation section and template segments all have the same overall structure:
1.
|
Identifier line - (Required) Identifies the entire template or template segment by name.
|
2.
|
Declaration part - (Optional) Contains the definitions of any constants, or variables used by the template section during execution. Identifiers declared in the initiation section are global, i.e., they may be used throughout the template; in the initiation section (only) you may include parameter declarations, as well as variables and constants.
|
3.
|
Body - (Required) Contains execution statements. The body is composed of a BEGIN/END statement that delineates the section’s statements. Any number of statements may be found in the body. The initiation section may not include output statements.
|