!> Endnotes require an understanding of [Sections](usage/sections.md).
Endnotes allow you to add references that appear at the end of the document. They are ideal for academic papers, research documents, and formal publications where lengthy citations would clutter the main text.
?> For references that appear at the bottom of each page, see [Footnotes](usage/footnotes.md). To add endnotes to an existing document, see [Templates](usage/templates.md#footnotes-and-endnotes).
An `EndnoteReferenceRun` can be given its endnote's content, its `children`, instead of the id of one of the document's `endnotes`, as a [footnote](usage/footnotes.md#footnotes-with-their-content) can. The endnote is added to the document's endnotes when the document is written, with an id none of them has:
```ts live
import { Document, EndnoteReferenceRun, Paragraph, TextRun } from "docx";
const doc = new Document({
sections: [
{
children: [
new Paragraph({
children: [
new TextRun("The method is described elsewhere"),
new EndnoteReferenceRun({ children: [new Paragraph("Smith, A Book, 2001, page 12.")] }),