mlreportgen.dom.TemplateOrderedListLevelStyle Class
Namespace: mlreportgen.dom
Style formats for a specific list level in a
TemplateOrderedListStyle
object
Since R2024a
Description
This class represents a level of an ordered list style. Creating an
mlreportgen.dom.TemplateOrderedListLevelStyle
object populates the object's Levels
property with instances of this class. Use the LevelStyles
property to
format the ordered list's levels.
The mlreportgen.dom.TemplateOrderedListLevelStyle
class is a handle
class.
Properties
Level
— List level that this object formats
double
List level that this object formats, specified as an integer.
Attributes:
SetAccess | private |
NonCopyable | true |
Data Types: double
Formats
— Style sheet formats
[]
(default) | array of DOM formatting objects
Style sheet formats, specified as an array of DOM formatting objects. These formats define how this style affects report content.
Attributes:
NonCopyable | true |
NumberStyle
— Number style applied to this list level
"decimal"
(default) | character vector | string scalar
Style of numbering used for this list level, specified as one of these values.
Value | Marker Description | Supported Output Types |
---|---|---|
"circle" | Open circle | All |
"cjk-ideographic" | Plain ideographic numbers Example: | All |
"decimal" | Decimal number Example: | All |
"decimal-hierarchical" | Numbers that include the numbers of parent list levels. Example: 1. 1.1 1.2 1.2.1 1.2.2 2. | DOCX |
"decimal-leading-zero" | Decimal number with leading zero Example:
| All |
"disc" | Filled circle | All |
"hiragana" | Hiragana numbering Example: | HTML, PDF |
"hiragana-iroha" | Hiragana-iroha numbering Example: | HTML, PDF |
"katakana" | Katakana numbering Example: | All |
"katakana-iroha" | Katakana-iroha numbering Example: | All |
"lower-alpha" | Lowercase alphabetic numbering Example:
| All |
"lower-greek" | Lowercase Greek alphabetic numbering Example:
| HTML, PDF |
"lower-latin" | Lowercase Latin alphabetic numbering Example:
| All |
"lower-roman" | Lowercase Roman numerals Example: | All |
"none" | No marker | All |
"upper-alpha" | Uppercase alphabetic numbering Example:
| All |
"upper-latin" | Uppercase alphabetic numbering Example:
| All |
"upper-roman" | Uppercase Roman numerals Example: | All |
Attributes:
NonCopyable | true |
Data Types: char
| string
NumberFormats
— Number formats applied to this list level
[]
(default) | array of DOM formatting objects
Formats that are applied to only the list numbers for this level, specified as an array of DOM formatting objects.
Note
This property is ignored for PDF template output.
Attributes:
NonCopyable | true |
Tag
— Tag for mlreportgen.dom.TemplateOrderedListLevelStyle
object
character vector | string scalar
Tag for the mlreportgen.dom.TemplateOrderedListLevelStyle
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
Id
— Object identifier for mlreportgen.dom.TemplateOrderedListLevelStyle
object
character vector | string scalar
Object identifier for the mlreportgen.dom.TemplateOrderedListLevelStyle
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
Examples
Create and Use a Multilevel Ordered List Style in a Template
Create a multilevel ordered list style in a template and then apply that style in your document.
Create the Style in the Template
Import the DOM API namespace so that you do not have to use long, fully qualified names.
import mlreportgen.dom.*; t = Template("myTemplate","pdf"); open(t);
Create a list style.
listStyle = TemplateOrderedListStyle("myOrderedListStyle");
Define formats for level 1.
level1Style = listStyle.LevelStyles(1); level1Style.Formats = [Color("blue"), FontSize("32pt")];
Define formats for level 2.
level2Style = listStyle.LevelStyles(2); level2Style.Formats = [Color("red"), FontSize("16pt")];
Add style to the stylesheet.
addStyle(t.Stylesheet,listStyle);
Close the template.
close(t);
Use the Style from the Template in a Document
Create a document using the generated template.
d = Document("myDoc","pdf","myTemplate"); open(d);
Create a list object with 2 levels.
list = OrderedList(["first level item 1", "first level item 2"]); secondLevelList = OrderedList(["second level item 1", "second level item 2"]); append(list, secondLevelList);
Set the style name.
list.StyleName = "myOrderedListStyle";
Add the list to the document.
append(d,list);
Close and view the document.
close(d); rptview(d);
Version History
Introduced in R2024a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)