mlreportgen.ppt.Paragraph Class
Namespace: mlreportgen.ppt
Formatted block of text (paragraph)
Description
Use an object of the mlreportgen.ppt.Paragraph
class to include a
paragraph in a PPT API presentation. A paragraph can contain text or mlreportgen.ppt.Text
, mlreportgen.ppt.InternalLink
, or mlreportgen.ppt.ExternalLink
objects.
The mlreportgen.ppt.Paragraph
class is a handle
class.
Class Attributes
HandleCompatible | true |
ConstructOnLoad | true |
For information on class attributes, see Class Attributes.
Creation
Description
creates an empty paragraph object.paragraphObj
= mlreportgen.ppt.Paragraph
creates a paragraph that contains an paragraphObj
= mlreportgen.ppt.Paragraph(text
)mlreportgen.ppt.Text
object with the text specified by text
.
creates a paragraph that contains the text , internal link, or external link
specified by paragraphObj
= mlreportgen.ppt.Paragraph(pptElementObj
)pptElementObj
.
Input Arguments
Paragraph text, specified as a character vector or string scalar.
Presentation element to include in the paragraph, specified as an
mlreportgen.ppt.Text
,
mlreportgen.ppt.InternalLink
, or mlreportgen.ppt.ExternalLink
object.
Properties
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.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char
| string
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.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char
| string
Font color for the text, specified as a character vector or string scalar that contains a CSS color name or hexadecimal RGB value.
To use the name of a color, specify a CSS color name. For a list of CSS color names, seehttps://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.
Example: "blue"
Example: "#0000ff"
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char
| string
Font size of the text, specified as a character vector or string scalar that contains 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
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char
| string
Option to use bold for text, specified as a numeric or logical 1
(true
) or 0
(false
). To
make text bold, set this property to true
or
1
.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: logical
Whether to use italic for the text, specified as a numeric or logical 1
(true
) or 0
(false
). If
Italic
is true
or 1
, text
renders in italic. If Italic
is false
or
0
, text renders as straight.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: logical
Strikethrough style for the text, specified as one of these values:
"single"
— Single horizontal line"none"
—No strikethrough line"double"
— Double horizontal line
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char
| string
Whether to display the text as a subscript, specified as a numeric or logical
1
(true
) or 0
(false
). If Subscript
is
true
or 1
, text renders as a subscript. If
Subscript
is false
or 0
,
text renders as regular text.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: logical
Whether to display the text as a superscript, specified as a numeric or logical
1
(true
) or 0
(false
). If Superscript
is
true
or 1
, text renders as a superscript. If
Superscript
is false
or
0
, text renders as regular text.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: logical
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 |
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char
| string
Horizontal alignment of the text in this paragraph, specified as one of these values:
Value | Description |
---|---|
| Centered |
| Left-justified |
| Right-justified |
| Left and right-justified, spacing words evenly |
| Left and right-justified, spacing letters evenly |
| Left and right-justified Thai text, spacing characters evenly |
| Justification for Arabic text |
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char
| string
Indentation level of this paragraph, specified as an integer in the range
[1,9]. The value 1
indicates a top-level paragraph with
no indentation.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
Paragraph 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:
para = mlreportgen.ppt.Paragraph("my paragraph"); para.Style = [para.Style {Bold(true),FontColor("red")}];
See Presentation Formatting Approaches.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: cell
Parent of this object, specified as a PPT API object. A PPT API object must only have one parent.
Attributes:
GetAccess | public |
SetAccess | private |
NonCopyable | true |
Child elements of this object, specified as a cell array of PPT API objects.
Attributes:
GetAccess | public |
SetAccess | private |
NonCopyable | true |
Data Types: cell
Tag, specified as a character vector or string scalar. The PPT 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. Use this value to help identify
where an issue occurs during document generation.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char
| string
Object identifier, specified as a character vector or string scalar. The PPT API
generates a session-unique identifier when it creates the document element object. You
can specify your own value for Id
.
Attributes:
GetAccess | public |
SetAccess | public |
NonCopyable | true |
Data Types: char
| string
Methods
Examples
Create a presentation with two slides.
import mlreportgen.ppt.*; ppt = Presentation("myParagraphPresentation.pptx"); open(ppt); add(ppt,"Title Slide"); add(ppt,"Title and Content");
Create an mlreportgen.ppt.Paragraph
object to use for the
title. Make the text bold and red.
p = Paragraph("My Title"); p.Bold = true; p.FontColor = "red";
Replace the title for the first slide with the paragraph.
contents = find(ppt,"Title");
replace(contents(1),p);
Create a paragraph for the content of the second slide.
p1 = Paragraph("My slide content"); append(p1," for the second slide");
Replace the content with the p1
paragraph.
replace(ppt,"Content",p1);
Close and view the presentation.
close(ppt); rptview(ppt);
Here are the slides in the generated presentation:
Version History
Introduced in R2015b
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)