Main Content

mlreportgen.dom.Italic class

Package: mlreportgen.dom

Italic for mlreportgen.dom.Text object

Description

Use an object of the mlreportgen.dom.Italic class to italicise the text in a Text object.

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

Class Attributes

HandleCompatible
true
ConstructOnLoad
true

Creation

Description

example

italicObj = mlreportgen.dom.Italic() creates a format object to italicize the text in a Text object.

example

italicObj = mlreportgen.dom.Italic(value) sets the Value property to value. When value is true, the text in the Text object is italicized. When value is false, the text is roman.

Properties

expand all

Whether to use italic for the text in the paragraph, specified as a numeric or logical 1 (true) or 0 (false).

  • true — Renders text in italic

  • false — Renders text in roman

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: logical

Tag for this document element, specified as a character vector or string scalar.

The DOM 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. Specifying your own tag value can help you to identify where an issue occurred during document generation.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

ID for this document element, specified as a character vector or string scalar. The DOM generates a session-unique ID when it creates the document element. You can specify your own ID.

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Examples

collapse all

In this example, you italicize the text in a Document object by using an Italic object.

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

import mlreportgen.dom.*

Create a Document object.

d = Document("mydoc","html");

Create a Paragraph object that contains the text that you want to italicize.

para = Paragraph("italic text");

Italicize the text in para by using an Italic object. Append the italicized paragraph to the document.

para.Style = {Italic()};
append(d,para);

Close and view the report.

close(d);
rptview("mydoc", "html");

In this example, you append italicized and roman text in a Document object by using an Italic object.

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

import mlreportgen.dom.*

Create a Document object.

d = Document("mydoc","html");

Create a Paragraph object that contains the text that you want to italicise.

para1 = Paragraph("italic text");

Italicize the text in para1 by using an Italic object with the value set to true. Append the italicized paragraph to the document.

para1.Style = {Italic(true)};
append(d,para1);

Create a Paragraph object that contains the text that you want in roman font.

para2 = Paragraph("roman text");

Keep the text in para2 in roman font by using an Italic object with the value set to false. Append the paragraph to the document.

para2.Style = {Italic(false)};
append(d,para2);

Close and view the report.

close(d);
rptview("mydoc", "html");
Introduced in R2014b