主要内容

本页采用了机器翻译。点击此处可查看英文原文。

mlreportgen.ppt.HAlign 类

命名空间: mlreportgen.ppt

段落水平对齐

描述

指定段落的水平对齐方式。

mlreportgen.ppt.HAlign 类是一个 handle 类。

创建对象

描述

alignObj = HAlign 创建一个具有值的水平对齐对象 "left"

alignObj = HAlign(value) 创建具有指定值的水平对齐对象。

示例

输入参量

全部展开

水平对齐,指定为以下值之一:

描述

"center"

居中

"left"

左对齐

"right"

右对齐

"justified"

左右对齐,单词间距均匀

"distributed"

左右对齐,字母间距均匀

"thaiDistributed"

泰语文本左右对齐,字符间距均匀

"justifiedLow"

阿拉伯语文本的对齐方式

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

属性

全部展开

水平对齐,指定为以下值之一:

描述

"center"

居中

"left"

左对齐

"right"

右对齐

"justified"

左右对齐,单词间距均匀

"distributed"

左右对齐,字母间距均匀

"thaiDistributed"

泰语文本左右对齐,字符间距均匀

"justifiedLow"

阿拉伯语文本的对齐方式

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

属性:

GetAccess
public
SetAccess
public
NonCopyable
true

数据类型: char | string

标记,指定为字符向量或字符串标量。PPT API 在创建此对象的过程中生成一个会话唯一标记。生成的标记形式为 CLASS:ID,其中 CLASS 是对象类,ID 是对象的 Id 属性的值。使用此值来帮助确定在文档生成过程中出现的问题的位置。

属性:

GetAccess
public
SetAccess
public
NonCopyable
true

数据类型: char | string

目标标识符,指定为字符向量或字符串标量。PPT API 在创建文档元素对象时会生成一个会话唯一标识符。您可以为 Id 指定自己的值。

属性:

GetAccess
public
SetAccess
public
NonCopyable
true

数据类型: char | string

示例

全部折叠

PPT API 默认模板中的演示文稿标题页是将标题左对齐。此示例通过将段落居中来覆盖默认设置。

创建演示文稿并添加标题幻灯片。

import mlreportgen.ppt.*

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

创建一个居中段落。

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

将段落添加到幻灯片,生成演示文稿,然后打开 myHAlignPresentation

replace(titleSlide,"Title",p);

close(ppt);
rptview(ppt);

MATLAB®:

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

版本历史记录

在 R2015b 中推出