| Search Locate Previous Next | Contents |
Master pages are saved by the designer in standard APL matrices. To set a single page layout as the working definition:
leaf.Use mypage © work with layout mypage
As you flow and place text, it will snake around the frames on the page layout until no more remain. The page will then be spooled to file, and a new page will be started using the same master, with any page numbers (marked by &p in fixed text) incremented automatically.
Note that you can pass a null argument to leaf.Use, in which case NewLeaf provides a default layout consisting of a single frame (with 1 margins all round) and a page number centred at the foot of the page.
If you have marked any parameters in the fixed text (using placeholders %1 to %9) you can substitute values for these by passing up to 9 items as the left argument to leaf.Use:
'Sales' 1998 leaf.Use salesrep
This will replace %1 with Sales and %2 with 1998 in the report master. You can update these substitutions at any time (see leaf.Subst for details).
Using a set of master pages
A common requirement is to alternate between left and right masters, possibly with a different design for the first page. It may also be necessary to make a follow-on page for a form letter which omits the address box. Simply pass a vector of page definitions to leaf.Use:
leaf.Use left right © alternates leaf.Use first left right © different 1st page leaf.Use (addr),2½followon © letter with follow-on pages
Note that NewLeaf uses up the pages until only two remain, then these are alternated. If you know exactly where your section breaks will occur, simply pass a vector of page definitions, reshaped to match your document.