主要内容

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

mlreportgen.report.Section.number

类: mlreportgen.report.Section
命名空间: mlreportgen.report

设置章节编号

语法

mlreportgen.report.Section.number(report,numbering)

说明

mlreportgen.report.Section.number(report,numbering) 表示是否在报告章节标题前包含数字。报告节默认连续编号。

输入参数

全部展开

报告,指定为报告对象。要创建 report 输入,请使用 mlreportgen.report.Report

选择对报告节进行编号,以逻辑形式指定。如果编号为 true,则报告节将连续编号。如果编号为 false,则报告节不包含编号。您可以使用节的 Numbered 属性来覆盖该节的编号。

示例

全部展开

关闭报告 API 报告中的章节编号。

import mlreportgen.report.*
import mlreportgen.dom.*
rpt = Report("My Report","pdf");
add(rpt,TitlePage("Title","My Report",...
     "Author","MathWorks"));
add(rpt,TableOfContents);
add(rpt,Chapter("Title","Boeing 747",...
     "Content","This report describes the Boeing 747."));
KeepWithNext(1);
add(rpt,Section("Title","Image of Boeing 747",...
     "Content",Image(which("b747.jpg")),"Numbered",0));
close(rpt);
rptview(rpt);

版本历史记录

在 R2017b 中推出