Main Content

mlreportgen.dom.FootnoteOptions Class

Namespace: mlreportgen.dom

Specify footnote options of a DOCX or PDF document or document section

Since R2024a

Description

The Document Object Model (DOM) API uses the mlreportgen.dom.FootnoteOptions class as the default value for the FootnoteOptions property of document and page layout objects. Set the properties of those mlreportgen.dom.FootnoteOptions objects to specify the footnote options of documents and document page layout sections. You do not need to create instances of this class yourself. If you specify the FootnoteOptions property for both a section and the document that contains it, the FootnoteOptions property of the section will take precedence. The document uses the default value if any property of mlreportgen.dom.FootnoteOptions is empty.

The mlreportgen.dom.FootnoteOptions class is a handle class.

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Properties

expand all

Footnote mark numbering type, specified as one of these valid numbering types:

  • "decimal" (default)

  • "upperRoman"

  • "lowerRoman"

  • "upperLetter"

  • "lowerLetter"

  • "chicago"

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Start value of footnote mark numbering, specified as a positive integer. If you specify a value that contains a decimal, the class rounds down the value to the nearest integer.

If you set the NumberingRestart property to "eachSect" or "eachPage" and you use this class on a DOCX document, the numbering restarts to 1 at the beginning of each section or page regardless of this property value.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: double

Where to restart footnote numbering, specified as one of these options:

  • "continuous" (default) — Footnote numbering continues iteratively without restarting.

  • "eachSect"— Footnote numbering restarts at the beginning of each new section of the document.

  • "eachPage"— Footnote numbering restarts at the beginning of each new page of the document. You can set NumberingRestart to this value only for DOCX documents.

If you set this property to "eachSect" or "eachPage" and you use this class on a DOCX document, the numbering restarts to 1 at the beginning of each section or page regardless of the NumeringStartValue property value.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Location of footnotes, specified as "pageBottom" or "beneathText". The location can be either the bottom of the page, "pageBottom", or at the end of the text on the page, "beneathText" (DOCX only).

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Tag, specified as a character vector or string scalar. The DOM API generates a session-unique tag as part of the creation of this object. The generated tag has the form CLASS:ID, where CLASS is the object class and ID is the value of the Id property of the object. Use this value to help identify where an issue occurs during document generation.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Object identifier, specified as a character vector or string scalar. The DOM API generates a session-unique identifier when it creates the document element object.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: char | string

Examples

collapse all

You can add footnotes to DOCX and PDF reports.

Import the DOM API package so you do not have to use fully qualified class names.

import mlreportgen.dom.*;

Create a document.

d = Document("report","docx");

Open the document and add a paragraph.

open(d);
para = Paragraph("When work began on the Parthenon");

Set document-wide footnote options.

d.FootnoteOptions.NumberingType = "lowerRoman";
d.FootnoteOptions.NumberingStartValue = 2;

Create a footnote and append it to the paragraph.

footnote = Footnote("The temple of Athena Parthenos, completed in 438 B.C., regarded as finest Doric temple");
append(para,footnote);
append(para,", the Athenian empire was at the height of its power.");
append(d,para);

para = Paragraph("Second paragraph begins here");

Create a second footnote and append it to the paragraph.

footnote = Footnote("Second footnote text");
append(para,footnote);
append(para,", some more text.");
append(d,para);

Close and view the report.

close(d);
rptview(d);

Version History

Introduced in R2024a