Main Content

mlreportgen.ppt.HAlign class

Package: mlreportgen.ppt

Horizontal alignment of paragraph

Description

Specify the horizontal alignment of a paragraph.

Construction

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

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

Input Arguments

expand all

Horizontal alignment, specified as one of these values:

  • 'center' — Centered

  • 'left' — Left justified

  • 'right' — Right justified

  • 'justified' — Left justified and right justified, spacing words evenly

  • 'distributed' — Left justified and right justified, spacing letters evenly

  • 'thaiDistributed' — Left justified and right justified Thai text, spacing characters evenly

  • 'justifiedLow' — Justification for Arabic text

Output Arguments

expand all

Horizontal alignment, returned as an mlreportgen.ppt.HAlign object.

Properties

expand all

ID for this PPT API object, specified as a character vector or string scalar. A session-unique ID is generated as part of object creation. You can specify an ID to replace the generated ID.

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 an issue occurred during presentation generation.

Horizontal alignment, specified as one of these values:

  • 'center' — Centered

  • 'left' — Left justified

  • 'right' — Right justified

  • 'justified' — Left justified and right justified, spacing words evenly

  • 'distributed' — Left justified and right justified, spacing letters evenly

  • 'thaiDistributed' — Left justified and right justified Thai text, spacing characters evenly

  • 'justifiedLow' — Justification for Arabic text

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®:

Introduced in R2015b