Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)


generates a document by evaluating all template elements in the notebook nb.

generates a document using args to fill template slots.

writes the generated document in the output file represented by output.

uses args to fill template slots and puts the result in output.


  • The notebook nb can be an explicit notebook expression, a NotebookObject, or a file name.
  • GenerateDocument typically works with template notebooks, which can usually be created interactively.
  • If the notebook nb does not contain any template elements, GenerateDocument effectively operates like NotebookEvaluate.
  • If the notebook nb contains template elements, GenerateDocument will fill template slots from args.
  • A positional template slot i is filled from the i^(th) position of args.
  • A named template slot "name" is filled from an element with key "name" in an association appearing in the first position of args.
  • A blank template notebook suitable for use with GenerateDocument can be opened in the front end using CreateNotebook["Template"].

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Generate a notebook by evaluating template elements in a template notebook:

Click for copyable input

The template notebook:

The generated document:

Introduced in 2014