Skip to content

footnotes

footnotes

Contains the footnotes of the document.

FootnotesPart

FootnotesPart(
    partname: PackURI,
    content_type: str,
    element: CT_Footnotes,
    package: Package,
)

Bases: StoryPart

Container part for the footnotes of the document.

Source code in src/docx/parts/footnotes.py
def __init__(
    self, partname: PackURI, content_type: str, element: CT_Footnotes, package: Package
):
    super().__init__(partname, content_type, element, package)
    self._footnotes = element

footnotes property

footnotes: Footnotes

A Footnotes proxy for the w:footnotes root element of this part.

default classmethod

default(package: Package) -> Self

A newly created footnotes part.

It holds the two structural footnotes Word requires — the separator and the continuation separator, at ids -1 and 0 — and no author footnotes.

Source code in src/docx/parts/footnotes.py
@classmethod
def default(cls, package: Package) -> Self:
    """A newly created footnotes part.

    It holds the two structural footnotes Word requires — the separator and the
    continuation separator, at ids -1 and 0 — and no author footnotes.
    """
    partname = PackURI("/word/footnotes.xml")
    content_type = CT.WML_FOOTNOTES
    element = cast("CT_Footnotes", parse_xml(cls._default_footnotes_xml()))
    return cls(partname, content_type, element, package)