mlreportgen.ppt.Text Class
Namespace: mlreportgen.ppt
Text to include in a presentation
Description
Use an object of the mlreportgen.ppt.Text
class to include text in a PPT API
presentation.
The mlreportgen.ppt.Text
class is a handle
class.
Class Attributes
HandleCompatible | true |
ConstructOnLoad | true |
For information on class attributes, see Class Attributes.
Creation
Properties
Content
— Text contained by this document element
''
(default) | character vector | string scalar
Text contained by this document element, specified as a character vector or string scalar.
Attributes:
NonCopyable | true |
Data Types: char
| string
Bold
— Whether to use bold for text
[]
(default) | true
| false
Whether to use bold for the text, specified as true
or
false
. Specify true
for bold text.
Data Types: logical
Font
— Font family for text
[]
(default) | character vector | string scalar
Font family for the text, specified as a character vector or string scalar. Specify a font that appears in the font list in Microsoft® PowerPoint®. To see the font list, in PowerPoint, on the Home tab, in the Font group, click the arrow to the right of the font.
ComplexScriptFont
— Font family for complex scripts
[]
(default) | character vector | string scalar
Font family for complex scripts, specified as a character vector or string scalar. Specify a font family to use when substituting in a locale that requires a complex script, such as Arabic or Asian, to render text.
FontColor
— Font color for text
[]
(default) | character vector | string scalar
Font color for the text, specified as a character vector or string scalar that consists of a CSS color name or hexadecimal RGB value.
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.
FontSize
— Font size of text
[]
(default) | character vector | string scalar
Font size of the text, specified as a character vector or string scalar that consists of a number followed by a unit of measurement. For example, '11pt'
specifies 11 points. Valid abbreviations are:
"px"
— pixels"cm"
— centimeters"in"
— inches"mm"
— millimeters"pc"
— picas"pt"
— points
Data Types: char
| string
Italic
— Whether to use italic for text
[]
(default) | true
| false
Whether to use italic for the text, specified as true
or
false
. Specify true
for italic text.
Data Types: logical
Strike
— Strikethrough style for text
[]
(default) | 'single'
| 'none'
| 'double'
Strikethrough style for the text, specified as one of these values:
'single'
— Single horizontal line'none'
— No strikethrough line'double'
— Double horizontal line
Subscript
— Whether to display text as a subscript
[]
(default) | true
| false
Whether to display the text as a subscript, specified as true
or
false
. A setting of true
renders the text as a
subscript.
Data Types: logical
Superscript
— Whether to display text as a superscript
[]
(default) | true
| false
Whether to display the text as a superscript, specified as true
or
false
. A setting of true
renders the text as a
superscript.
Data Types: logical
Underline
— Underline style for text
[]
(default) | 'single'
| 'double'
| ...
Underline style for the text, specified as one of these values:
Value | Description |
---|---|
"single" | Single underline |
"double" | Double underline |
"heavy" | Thick underline |
"words" | Only words underlined (not spaces) |
"dotted" | Dotted underline |
"dottedheavy" | Thick, dotted underline |
"dash" | Dashed underline |
"dashheavy" | Thick, dashed underline |
"dashlong" | Long, dashed underline |
"dashlongheavy" | Thick, long, dashed underline |
"dotdash" | Dot-dash underline |
"dotdashheavy" | Thick, dot-dash underline |
"dotdotdash" | Dot-dot-dash underline |
"dotdotdashheavy" | Thick, dot-dot-dash underline |
"wavy" | Wavy underline |
"wavyheavy" | Thick, wavy underline |
"wavydouble" | Wavy, double underline |
"none" | No underline |
Style
— Text formatting
cell array of PPT format objects
Text formatting, specified as a cell array of PPT format objects.
Add format objects by concatenating the existing value of the
Style
property with a cell array that contains the
format objects that you are adding. For
example:
txt = mlreportgen.ppt.Text('my text'); txt.Style = [txt.Style {Bold(true),FontColor('red')}];
Children
— Children of this PPT API object (not used)
[]
This property is not used.
Parent
— Parent of this PPT API object
PPT object
Parent of this object, specified as a PPT object.
Attributes:
SetAccess | private |
NonCopyable | true |
Tag
— Tag for this PPT API object
character vector | string scalar
Tag for this PPT API object, specified as a character vector or string scalar. A session-unique tag is generated 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 issues occur during presentation generation.
Attributes:
NonCopyable | true |
Data Types: char
| string
Id
— ID for this PPT API object
character vector | string scalar
ID for this PPT API object, specified as a character vector or string scalar. A session-unique ID is generated as part of the object creation. You can specify an ID to replace the generated ID.
Attributes:
NonCopyable | true |
Data Types: char
| string
Methods
Public Methods
clone |
Use the
|
Examples
Add Text to a Presentation
Use an mlreportgen.ppt.Text
object to add text to a presentation. This example uses mlreportgen.ppt.Text
objects to add text to the title of one slide and the content of another slide.
Create a presentation.
import mlreportgen.ppt.* ppt = Presentation("myTextPresentation.pptx"); open(ppt);
Add two slides to the presentation.
slide1 = add(ppt,"Title Slide"); slide2 = add(ppt,"Title and Content");
Create an mlreportgen.ppt.Paragraph
object to use for the title of the presentation.
p1 = Paragraph;
Create an mlreportgen.ppt.Text
object with bold and red content, and append it to the paragraph.
titleText = Text("My Presentation Title"); titleText.Bold = true; titleText.FontColor = "red"; append(p1,titleText);
Replace the title in the first slide with the paragraph.
replace(slide1,"Title",p1);
Create a paragraph for the content of the second slide.
p2 = Paragraph("My content"); append(p2,Text(" for the second slide"));
Replace the content in the second slide with the paragraph.
replace(slide2,"Content",p2);
Close and view the presentation.
close(ppt); rptview(ppt);
Here are the slides in the generated presentation:
Version History
Introduced in R2015b
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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)