Notes are in two parts, word/footnotes.xml and
word/endnotes.xml, reached by the footnotes and
endnotes relationships. The main text only marks where each note is
referred to. Both parts have the same shape, so this page shows footnotes.
The reference in the text
<w:r>
<w:rPr><w:rStyle w:val="FootnoteReference"/></w:rPr>
<w:footnoteReference w:id="2"/>
</w:r>
An endnote uses w:endnoteReference in the same way.
The notes part
<w:footnotes xmlns:w="…">
<w:footnote w:type="separator" w:id="-1">
<w:p><w:r><w:separator/></w:r></w:p>
</w:footnote>
<w:footnote w:type="continuationSeparator" w:id="0">
<w:p><w:r><w:continuationSeparator/></w:r></w:p>
</w:footnote>
<w:footnote w:id="2">
<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"> The note's text.</w:t></w:r>
</w:p>
</w:footnote>
</w:footnotes>
| Item | Meaning |
|---|---|
w:id | What the reference names. It is not the number shown. |
w:type | normal (the default), separator (the line above the notes), continuationSeparator, or continuationNotice. |
w:footnoteRef | In the note, where the note’s own number is printed. |
A note’s content is block-level, like the document body: paragraphs and tables.
The numbers shown
The number shown is not stored. Footnotes are numbered in the order they are referred to
in the document, starting from the value in the footnote properties, and the IDs in the
file can be in any order and have gaps. A reference with
w:customMarkFollows uses a custom mark from the following run instead of a
number.
Numbering format, restart and position come from w:footnotePr and
w:endnotePr, in word/settings.xml for the document and in a
section’s w:sectPr for that section.
The properties, as ECMA-376 Part 1 17.11 defines them:
w:numStart(17.11.20): the number of the first note, and of the first note after each restart; a decimal value shown in the note's format (4 withupperLettershows D). 1 if omitted.w:numRestart(17.11.19), ST_RestartNumber (17.18.74):continuous(the default when omitted),eachSectoreachPage. Footnotes and endnotes restart independently. The viewer restarts at the first section and oneachSect, takes the properties from the section over the document settings, and countseachPageascontinuous.w:numFmt(17.11.17): the format of the reference marks. The viewer writes the number in that format (lowerRomanis the default for endnotes, decimal for footnotes);bulletcounts as decimal for the marks.w:pos, footnotes (17.11.21), ST_FtnPos:beneathText,pageBottom,sectEndordocEnd; at document level, footnotes go to the bottom of the page when it is omitted, and aw:posin a section'sw:footnotePris ignored. Word differs from the standard here (MS-OI29500 2.1.541): it does not supportdocEnd, and treatssectEndlikebeneathText, showing the footnotes right after the last line of text on the page that holds the reference mark. The viewer always puts footnotes at the bottom of the page and does not act onw:pos.w:pos, endnotes (17.11.22), ST_EdnPos:docEnd(the default when omitted at document level) orsectEnd; a section-level one is ignored.w:noEndnote(17.11.16) suppresses endnotes in the document.
Rules for a valid file: a w:footnote or w:endnote without w:type is a normal note; a note of any other type (separator, continuationSeparator, continuationNotice) must not be referenced from the main story (17.11.10); two footnotes with the same w:id, or two endnotes, are non-conformant (17.11.9, 17.11.10); a special note the document needs but that is not listed in the w:footnotePr list of w:footnote w:id elements is non-conformant (17.11.9). The specification's own examples give the separators the IDs 0 and 1, and the example above uses -1 and 0; an ID only has to be unique and match its reference.