Main Content

mlreportgen.dom.Endnote Class

Namespace: mlreportgen.dom

Create endnote in DOCX or PDF report

Since R2024a

Description

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

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

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

Description

endnote = Endnote creates a default endnote object.

endnote = Endnote(text) creates an endnote object, and appends its children with the Text object created using the specified string.

example

endnote = Endnote(double) creates an endnote object, and appends its children with the Number object created using the specified double value.

endnote = Endnote(docElementObj) creates an endnote object, and appends the specified DOM object to its children.

endnote = Endnote(___,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.Endnote 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.Endnote object is "1", incrementing for each additional mlreportgen.dom.Endnote 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 you append this object. The specified style defines the appearance of this object 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 endnote mark, not to the contents of the endnote.

Attributes:

NonCopyable
true

Data Types: char | string

Format specification for this endnote mark, specified as an array of format objects. The formats specified by this property override corresponding formats specified by the StyleName property. The endnote ignores formats that do not apply to this document element object.

Note

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

Attributes:

NonCopyable
true

Parent of mlreportgen.dom.Endnote 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.Endnote 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 the mlreportgen.dom.Endnote 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 the mlreportgen.dom.Endnote 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 endnotes 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 an endnote, and append it to the paragraph.

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

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

Create an endnote, with a custom mark and append it to the paragraph.

endnote = Endnote("Second endnote text","A");
append(para,endnote);
append(para,", some more text.");
append(d,para);

Close and view the report.

close(d);
rptview(d);

Version History

Introduced in R2024a