mlreportgen.dom.AutoNumber Class
Namespace: mlreportgen.dom
Automatically generated number
Description
Automatically generated number for a DOM document element object.
The mlreportgen.dom.AutoNumber
class is a handle
class.
Creation
Description
Input Arguments
stream
— Numbering stream for generating the number
character vector
Specify a numbering stream, using the value of the
mlreportgen.dom.AutoNumberStream
object
StreamName
property.
If the specified stream does not exist, the DOM interface creates an Arabic number
stream having the specified name with an initial value of 0. To use a stream with
other properties, such as Roman numerals, create a stream using
mlreportgen.dom.Document.createAutoNumberStream
.
styleName
— Name of number style defined in the template
character vector
Name of number style defined in the template, specified as a character vector or string scalar. The
style specified by styleName
must be defined in the template used
to create the document to which the number is appended.
Properties
BackgroundColor
— Background color
[]
(default) | character vector | string scalar
Background color that consists of a CSS color name or a hexadecimal RGB value, specified as a character vector or string scalar.
For a list of CSS color names, see https://www.w3.org/wiki/CSS/Properties/color/keywords.
To specify a hexadecimal RGB format, use
#
as the first character and two-digit hexadecimal numbers for the red, green, and blue values. For example,"#0000ff"
specifies blue.
Note
Setting the BackgroundColor
property adds a
mlreportgen.dom.BackgroundColor
format object to the
Style
property. Setting the
BackgroundColor
property to an empty value removes the
object.
Example: "blue"
Example: "#0000ff"
Attributes:
NonCopyable | true |
Data Types: char
| string
Bold
— Option to use bold for document element
[]
(default) | true
or 1
| false
or 0
Option to use bold for this document element, specified as a numeric or logical
1
(true
) or 0
(false
). To make document element bold, set
Bold
to true
or 1
.
Note
Setting the Bold
property adds a corresponding
mlreportgen.dom.Bold
format object to the
Style
property. Setting the Bold
property
to an empty value removes the object.
Attributes:
NonCopyable | true |
Data Types: logical
Color
— Document element object color
[]
(default) | character vector | string scalar
Document element object color that consists of a CSS color name (see https://www.w3.org/wiki/CSS/Properties/color/keywords) or a hexadecimal RGB (truecolor) value in the form
#RRGGBB
, specified as a character vector or
string scalar.
Note
Setting the Color
property adds a corresponding
mlreportgen.dom.Color
format object to the
Style
property. Setting the
Color
property to an empty value removes
the object.
Example: "blue"
Example: "#0000ff"
Attributes:
NonCopyable | true |
Data Types: char
| string
FontFamilyName
— Name of font family for text
[]
| character vector | string scalar
Name of a font family to use for text, specified as a character vector or string scalar. To
specify substitutions for the font, do not specify the font
family by setting this property. Instead, create and add an
mlreportgen.dom.FontFamily
object
to the Style
property.
Note
Setting the FontFamilyName
property
adds a corresponding
mlreportgen.dom.FontFamily
format object to the Style
property. Setting the
FontFamilyName
property is the
same as setting the FontName
property of an
mlreportgen.dom.FontFamily
object. Setting the
FontFamilyName
property to an
empty value removes the object.
Example: "Courier New"
Attributes:
NonCopyable | true |
Data Types: char
| string
FontSize
— Font size for document element
[]
(default) | character vector | string scalar
Font size to use for document element that consists of a number followed by an
abbreviation for a unit of measurement, specified as a character vector or string
scalar. For example, "12pt"
specifies twelve points. Valid
abbreviations are:
"px"
— pixels"cm"
— centimeters"in"
— inches"mm"
— millimeters"pc"
— picas"pt"
— points
Note
Setting the FontSize
property adds a corresponding
mlreportgen.dom.FontSize
format object to the
Style
property. Setting the FontSize
property to an empty value removes the object.
Example: "12pt"
Attributes:
NonCopyable | true |
Data Types: char
| string
Italic
— Option to use italic for document element
[]
(default) | true
or 1
| false
or 0
Option to use italic for document element, specified as a numeric or logical
1
(true
) or 0
(false
). To make document element italic, set
Italic
to true
or 1
.
Note
Setting the Italic
property adds a corresponding
mlreportgen.dom.Italic
format object to the
Style
property. Setting the Italic
property to an empty value removes the object.
Attributes:
NonCopyable | true |
Data Types: logical
Strike
— Text strikethrough
[]
(default) | "none"
| "single"
| "double"
Text strikethrough, specified as one of these values:
"none"
— No strikethrough"single"
— Single line"double"
— Double line (for Word reports only)
Note
Setting the Strike
property adds a corresponding
mlreportgen.dom.Strike
format object to the
Style
property for this document element. Setting the
Strike
property to an empty value removes the object.
Attributes:
NonCopyable | true |
Data Types: char
| string
Underline
— Type of underline
[]
(default) | "single"
| "none"
| ...
Type of underline, specified as one of the values in this table.
Underline value | Description | Supported Output Types |
---|---|---|
| Single line | All |
| Underline all characters except spaces | Word |
| Double line | Word |
| Thick line | Word |
| Dotted line | Word |
| Thick dotted line | Word |
| Dashed line | Word |
| Line with heavy dashes | Word |
| Line with long dashes | Word |
| Line with heavy long dashes | Word |
| Dot-dash line | Word |
| Heavy dash-dot line | Word |
| Dot-dot-dash line | Word |
| Line with heavy dashes and two dots between the dashes | Word |
| Wavy line | Word |
| Heavy wavy | Word |
| Double wavy line | Word |
| No underline | All |
To specify both the color and the type of the underline, do not set the Underline
property. Instead, set the Style
property to include an mlreportgen.dom.Underline
format object that specifies the underline type and color.
Note
Setting the Underline
property adds a corresponding
mlreportgen.dom.Underline
format object to the
Style
property. Setting the Underline
property to an empty value removes the object.
Attributes:
NonCopyable | true |
Data Types: char
| string
WhiteSpace
— How to treat white space in text
[]
(default) | "normal"
| "nowrap"
| ...
How to treat white space and line breaks in text, specified as one of the values in this table.
Value | Description | Supported Output Types |
---|---|---|
| For HTML and PDF, this value removes spaces at the beginning and the end of text. Multiple spaces in the text collapse to a single space. For Microsoft® Word, this value removes spaces at the beginning and end of text. | All |
| Sequences of white space collapse into a single white space. Text never wraps to the next line. | HTML |
| Preserves white space. Text wraps only on line breaks. Acts
like the | HTML and PDF |
| Same as "pre". | All |
| Sequences of white space collapse into a single white space. Text wraps when necessary and on line breaks. | HTML and PDF |
| Preserves white space. Text wraps when necessary and on line breaks. | HTML and PDF |
Note
Setting the WhiteSpace
property adds a corresponding mlreportgen.dom.WhiteSpace
format
object to the Style
property. Setting the
WhiteSpace
property to an empty value removes the
object.
Data Types: char
| string
StyleName
— Name of stylesheet-defined style
[]
(default) | character vector | string scalar
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
Microsoft Word output ignores the style name.
Attributes:
NonCopyable | true |
Data Types: char
| string
Style
— Format specification
{}
(default) | array of DOM format objects
Format specification for this document element object, specified as an array of DOM
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 document element object are ignored.
Attributes:
NonCopyable | true |
CustomAttributes
— Custom attributes of document element
[]
(default) | array of mlreportgen.dom.CustomAttribute
objects
Custom attributes of this document element, specified as an array of mlreportgen.dom.CustomAttribute
objects. The custom attributes must be
supported by the output format of the document element to which this object is
appended.
Attributes:
NonCopyable | true |
Id
— Object identifier for mlreportgen.dom.AutoNumber
object
character vector | string scalar
Object identifier for the mlreportgen.dom.AutoNumber
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
Tag
— Tag for mlreportgen.dom.AutoNumber
object
character vector | string scalar
Tag for the mlreportgen.dom.AutoNumber
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
Methods
Examples
Use Automatically Generated Numbers for Chapters and Tables
import mlreportgen.dom.*; doctype = 'html'; d = Document('test',doctype); p = Paragraph('Chapter '); p.Style = {CounterInc('chapter'),CounterReset('table'),... WhiteSpace('preserve')}; append(p,AutoNumber('chapter')); append(d,p); p = Paragraph('Table '); append(p,AutoNumber('chapter')); append(p,'.'); append(p,AutoNumber('table')); p.Style = {CounterInc('table'),WhiteSpace('preserve')}; append(d,p); p = Paragraph('Chapter '); p.Style = {CounterInc('chapter'),CounterReset('table'),... WhiteSpace('preserve')}; append(p,AutoNumber('chapter')); append(d,p); p = Paragraph('Table '); append(p, AutoNumber('chapter')); append(p,'.'); append(p,AutoNumber('table')); p.Style = {CounterInc('table'),WhiteSpace('preserve')}; append(d,p); close(d); rptview('test',doctype);
Version History
Introduced in R2014b
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 (한국어)