Main Content

mlreportgen.dom.Footnote Class

Namespace: mlreportgen.dom

Create an footnote in DOCX and PDF reports

Since R2024a

Description

Use an object of the mlreportgen.dom.Footnote class to include an footnote in a DOCX or PDF report.

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

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

Description

footnote = Footnote creates a default footnote object.

example

footnote = Footnote(text) creates a footnote object and appends its children with the Text object created using the specified string.

footnote = Footnote(double) creates a footnote object and appends its children with the Number object created using the specified double value.

footnote = Footnote(docElementObj) creates a footnote object and appends the DOM object to the its children using the specified DOM object.

endnote = Footnote(___,customMark) sets the CustomMark property to customMark, in addition to any combination of input arguments from previous syntaxes.

Input Arguments

expand all

Text used to create a Text object, specified as a character vector or string scalar.

Data Types: char | string

Value used to create a Number object, specified as a numeric scalar.

Data Types: double

Properties

expand all

Custom mark of this mlreportgen.dom.Footnote object, specified as a string scalar or a character vector. The mark must be a maximum of 10 characters long. If this property is empty, the mark of the first mlreportgen.dom.Footnote object is "1", incrementing for each additional mlreportgen.dom.Footnote object.

Example: "A"

Attributes:

NonCopyable
true

Data Types: char | string

Style name, specified as a character vector or string scalar. The style name is the name of a style specified in the style sheet of the document or document part to which this element is appended. The specified style defines the appearance of this element in the output document unless overridden by the formats specified by the Style property of this element. To learn more about using style sheets, see Use Style Sheet Styles.

Note

This style applies only to the footnote mark, not to the contents of the footnote.

Attributes:

NonCopyable
true

Data Types: char | string

Format specification for this footnote mark, specified as an array of format objects. The formats specified by this property override corresponding formats specified by the StyleName property of this element. Formats that do not apply to this element are ignored.

Note

This style applies only to the footnote mark, not to the contents of the footnote.

Attributes:

NonCopyable
true

Parent of mlreportgen.dom.Footnote object, specified as a document element object. A document element object must have only one parent.

Note

You must append Footnote and Endnote objects to Paragraph objects.

Attributes:

SetAccess
private
NonCopyable
true

Children of mlreportgen.dom.Footnote object, specified as an array of document element objects. This property contains the document element objects appended using the append method.

Attributes:

SetAccess
private
NonCopyable
true

Tag for mlreportgen.dom.Footnote object, 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. Specify your own tag value to help you identify where to look when an issue occurs during document generation.

Attributes:

NonCopyable
true

Data Types: char | string

Object identifier for mlreportgen.dom.Footnote object, specified as a character vector or string scalar. The DOM API generates a session-unique identifier when it creates the document element object. You can specify your own value for Id.

Attributes:

NonCopyable
true

Data Types: char | string

Methods

expand all

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");

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 footnote, with a custom mark and append it to the paragraph.

footnote = Footnote("Second footnote text","A");
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