w:footnote (Footnote Definition)
Defines a single footnote, including its unique ID, optional type, and body content paragraphs.
Parent elements
Child elements
Description
w:footnote represents a single footnote in the Footnotes part. Each footnote has a unique integer ID that is referenced by w:footnoteReference in the main document body.
It is defined in ECMA-376 Part 1 §17.11.10.
Three types of footnote entries exist in the part: the separator line, the continuation separator, and regular user footnotes.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:id |
xsd:integer |
Any integer | Unique identifier for this footnote. Negative IDs (-1, 0) are reserved for separator entries. |
w:type |
ST_FtnEdn |
normal, separator, continuationSeparator, continuationNotice |
Type of footnote. Omitting w:type is equivalent to normal. |
w:type Values
| Value | Description |
|---|---|
normal |
A regular footnote (default). |
separator |
Defines the separator line drawn above the footnote text area. |
continuationSeparator |
Separator used when a footnote continues on the next page. |
continuationNotice |
Optional notice inserted at the bottom of the page when a footnote continues. |
Examples
<!-- Regular footnote with reference mark and text -->
<w:footnote w:id="1">
<w:p>
<w:pPr><w:pStyle w:val="FootnoteText"/></w:pPr>
<w:r>
<w:rPr><w:rStyle w:val="FootnoteReference"/></w:rPr>
<w:footnoteRef/>
</w:r>
<w:r>
<w:t xml:space="preserve"> ECMA-376, 5th Edition, Part 1.</w:t>
</w:r>
</w:p>
</w:footnote>
using DocumentFormat.OpenXml.Wordprocessing;
var footnote = new Footnote { Id = 1 };
var para = new Paragraph();
para.AppendChild(new ParagraphProperties(
new ParagraphStyleId { Val = "FootnoteText" }
));
var refRun = new Run();
refRun.AppendChild(new RunProperties(
new RunStyle { Val = "FootnoteReference" }
));
refRun.AppendChild(new FootnoteReferenceMark());
para.AppendChild(refRun);
var textRun = new Run();
textRun.AppendChild(new Text(" ECMA-376, 5th Edition, Part 1.")
{
Space = SpaceProcessingModeValues.Preserve
});
para.AppendChild(textRun);
footnote.AppendChild(para);
Notes
- The
w:footnoteRefelement (an empty marker) is placed inside the footnote body to render the auto-numbered reference mark within the footnote text. - Footnotes are numbered automatically based on the document’s
w:footnotePrsettings. - Word processors typically apply the built-in
FootnoteTextparagraph style andFootnoteReferencecharacter style automatically.