Page assembly

TopLeaf assembles content as a single column of data until it reaches a point where the layout can change, such as a page break or a switch between one-column and two-column material.

This design affects the rendering of a document in the following ways:

  • Data cannot flow to a format with a different column width unless the mappings force a new page type to be selected. For example, a chapter cannot start with a single-column layout and switch to double-column on the next page without a tag in the data to force the change.

  • It isn’t possible to find or set information about the current page (such as the page number) in a mapping since the content may be processed in the context of a different page to the one on which it finally appears.

  • Setting a variable to appear in a header or footer can cause unexpected results for the same reason.

To avoid problems with variables that depend on or affect the page context, you can use the following techniques:

  • Force a new page in the mapping. This means that the mapping will be processed in the context of the new page.

  • Information relating to a page can be viewed and changed in a header or footer mapping, since these will always return information about the page on which they appear.

    If you are maintaining a variable for the number of pages, the recommended place to increment it is in the $headfoot mapping.

    Data telltales provide a reliable means of extracting data from the page to display in headers and footers.