Main Content

mlreportgen.ppt.HAlign Class

Namespace: mlreportgen.ppt

Horizontal alignment of paragraph

Description

Specify the horizontal alignment of a paragraph.

The mlreportgen.ppt.HAlign class is a handle class.

Creation

Description

alignObj = HAlign creates a horizontal alignment object having the value 'left'.

alignObj = HAlign(value) creates a horizontal alignment object having the specified value.

example

Input Arguments

expand all

Horizontal alignment, specified as one of the values in the table.

ValueDescription

'center'

Centered

'left'

Left-justified

'right'

Right-justified

'justified'

Left and right-justified, spacing words evenly

'distributed'

Left and right-justified, spacing letters evenly

'thaiDistributed'

Left and right-justified Thai text, spacing characters evenly

'justifiedLow'

Justification for Arabic text

Arabic text, justified on the left and justified low on the right

Properties

expand all

Horizontal alignment, specified as one of the values in the table.

ValueDescription

'center'

Centered

'left'

Left-justified

'right'

Right-justified

'justified'

Left and right-justified, spacing words evenly

'distributed'

Left and right-justified, spacing letters evenly

'thaiDistributed'

Left and right-justified Thai text, spacing characters evenly

'justifiedLow'

Justification for Arabic text

Arabic text, justified on the left and justified low on the right

Tag for the mlreportgen.ppt.HAlign object, 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. 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

Object identifier for the mlreportgen.ppt.HAlign object, 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:

NonCopyable
true

Data Types: char | string

Examples

collapse all

The presentation title page in the PPT API default template is to left-justify the title. This example overrides that default by centering the paragraph.

Create a presentation and add a title slide.

import mlreportgen.ppt.*

ppt = Presentation('myHAlignPresentation.pptx');
open(ppt);
titleSlide = add(ppt,'Title Slide');

Create a centered paragraph.

p = Paragraph('Title for First Slide');
p.Style = {HAlign('center')};

Add the paragraph to the slide, generate the presentation, and open myHAlignPresentation.

replace(titleSlide,'Title',p);

close(ppt);
rptview(ppt);

MATLAB®:

Paragraph text "Title for First Slide" centered on the slide

Version History

Introduced in R2015b