mlreportgen.ppt.HAlign class

Package: mlreportgen.ppt
Superclasses:

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

Output Arguments

expand all

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

Properties

expand all

ID for PPT API object, specified as a character vector. 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. 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.

An example of a reason for specifying your own tag value is to make it easier 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- and right-justified, spacing words evenly

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

  • 'thaiDistributed' — Left- and right-justified text, adding extra spaces between characters for languages with tone and vowel marks

  • '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.*
slidesFile = 'myHAlignPresentation.pptx';
slides = Presentation(slidesFile);
titleSlide = add(slides,'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. (The winopen code works on Windows® platforms.)

replace(titleSlide,'Title',p);

close(slides);

if ispc
    winopen(slidesFile);
end

MATLAB®:

Introduced in R2015b