Skip to main content

Endnotes

Preview Feature

This module is currently in preview. Request access to try it out.

Adding endnotes to documents using the docstencil-docx-pro module.

Adding the Module

OfficeTemplateOptions options = new OfficeTemplateOptions()
.withModule(new EndnoteModule());
val options = OfficeTemplateOptions()
.withModule(EndnoteModule())

Basic Syntax

Use $endnote to insert an endnote reference:

This requires a reference{insert $endnote("See appendix for details")}*{end}.

The placeholder becomes an endnote reference number, and the text appears at the end of the document.

Dynamic Content

Use variables for endnote text:

{insert $endnote(reference.fullCitation)}*{end}

Endnotes vs Footnotes

FeatureFootnotesEndnotes
LocationBottom of each pageEnd of document
Best forBrief citations, asidesDetailed references, bibliography
ModuleFootnoteModuleEndnoteModule

Endnotes in Loops

Generate endnotes from a collection:

{for citation in citations}
{citation.text}{insert $endnote(citation.source)}*{end}
{end}

Combined Usage

You can use both footnotes and endnotes in the same document by adding both modules:

OfficeTemplateOptions options = new OfficeTemplateOptions()
.withModule(new FootnoteModule())
.withModule(new EndnoteModule());