GenerateDocument
✖
GenerateDocument
writes the generated document in the output file represented by output.
Details

- The nb can be a notebook in any of the following forms:
-
"file" or File["file"] explicit file name CloudObject[…] a cloud object LocalObject[…] a local object NotebookObject[…] a NotebookObject Notebook a Notebook expression - GenerateDocument[nb] and GenerateDocument[nb,args] return a notebook object.
- The output in GenerateDocument can be any of the following:
-
"file" or File["file"] explicit file name "!prog" export data to a pipe CloudObject[…] a cloud object LocalObject[…] a local object - 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
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"].
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Scope (1)Survey of the scope of standard use cases
Template elements can iterate over lists of data to create repeating blocks:

https://wolfram.com/xid/0h2okkyjyq-83zebs

Use the data in a template notebook:

https://wolfram.com/xid/0h2okkyjyq-5f725t

The Repeating Block element in the template notebook:

The result of evaluating the repeating block element:

Generalizations & Extensions (5)Generalized and extended use cases
Generated documents may contain anything notebooks may contain, including interactive elements:

https://wolfram.com/xid/0h2okkyjyq-h7oqmd

A copy of an interactive section of the generated report:

https://wolfram.com/xid/0h2okkyjyq-djnkpn

GenerateDocument can take the input template from a cloud object:

https://wolfram.com/xid/0h2okkyjyq-8oq5i0


https://wolfram.com/xid/0h2okkyjyq-9hb7ty

GenerateDocument can generate an output document deployed as a cloud object:

https://wolfram.com/xid/0h2okkyjyq-nxs0c6

Generate a document as a cloud object with Permissions and MetaInformation:

https://wolfram.com/xid/0h2okkyjyq-hefv1j
Deploy a template as a cloud object:

https://wolfram.com/xid/0h2okkyjyq-i12wzq
Generate a document locally using the deployed template; deploy the result as a cloud object:

https://wolfram.com/xid/0h2okkyjyq-p9yla0

Applications (1)Sample problems that can be solved with this function
Wolfram Research (2014), GenerateDocument, Wolfram Language function, https://reference.wolfram.com/language/ref/GenerateDocument.html (updated 2020).
Text
Wolfram Research (2014), GenerateDocument, Wolfram Language function, https://reference.wolfram.com/language/ref/GenerateDocument.html (updated 2020).
Wolfram Research (2014), GenerateDocument, Wolfram Language function, https://reference.wolfram.com/language/ref/GenerateDocument.html (updated 2020).
CMS
Wolfram Language. 2014. "GenerateDocument." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/GenerateDocument.html.
Wolfram Language. 2014. "GenerateDocument." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/GenerateDocument.html.
APA
Wolfram Language. (2014). GenerateDocument. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GenerateDocument.html
Wolfram Language. (2014). GenerateDocument. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GenerateDocument.html
BibTeX
@misc{reference.wolfram_2025_generatedocument, author="Wolfram Research", title="{GenerateDocument}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/GenerateDocument.html}", note=[Accessed: 19-June-2025
]}
BibLaTeX
@online{reference.wolfram_2025_generatedocument, organization={Wolfram Research}, title={GenerateDocument}, year={2020}, url={https://reference.wolfram.com/language/ref/GenerateDocument.html}, note=[Accessed: 19-June-2025
]}