Legacy Documentation

Publicon® (2004)

This is documentation for an obsolete product.
Current products and services

Documentation  / Publicon  / User Guide  / Advanced Features  / Creating Document Palettes  / Button Functions  /

Button Functions

GenerateDocument

GenerateDocument[args] creates a new document with a specified style sheet.

• The arguments of GenerateDocument are always specified as a list, which can take the following forms.
{}
{stylesheet}
{stylesheet, cell_list}
{stylesheet, cell_list, cursor_position}
{stylesheet, cell_list, cursor_position, fn}

where:

stylesheet specifies the style sheet to apply to the document

cell_list consists of the list of cells that will be initially present in the document. It may also be None, in which case no cells will initially appear in the document.

cursor_position specifies where the cursor should be positioned in the document. This can take values:
None - the cursor is positioned after the cells written into the document
Automatic - the cursor is positioned at the top of the document
{n, All} - the contents of the nth cell written in will be selected
{n, After} - the cursor is positioned after the nth cell written in
{cell_style, All} - the contents of the first cell with the style cell_style are selected
{cell_style, After} - the cursor is positioned after the first cell with style cell_style.

fn is any function that will be evaluated after the document has been constructed.

• When the argument is {}, the list used by GenerateDocument is {"PubliconDefault.nb", {Cell["Title....", "Title"], Cell["Section Head....", "Section"], Cell["Your text begins here....", "Text"]}, {1, All}, None}.

GenerateDocument has the option findAuthorForm whose default setting is True. With findAuthorForm Rule True, if an author form as well as an associated document are open, they will be brought to the foreground for work to be completed on that author form and a message will be generated. GenerateDocument in that instance will not do anything else. When the potential existence of an author form and associated document should be ignored, findAuthorForm should explicitly be set to False.