Main Content

Chapter/Subsection

Group portions of report into sections with titles

Description

This component groups portions of the report into sections. Each section has a title and content.

The following rules apply to this component:

  • Child components appear inside the section created by this component.

  • Selecting the Get title from first child component check box prevents this component from accepting paragraph-level children. In this case, this component's first child must be a Text component.

  • This component can have Chapter/Subsection components as its children.

  • Sections can be nested. There are seven levels of nesting possible. The seventh nested section in the report is untitled, although the child components of this section include information into the report.

Chapter Numbering

Chapter and subsection numbering depends on the template you select for template-based output, such as Word (from template), or the style sheet you select for style-sheet-based output, such as Adobe® Acrobat®.

To number chapters only in template-based output, select Default Word Template, Default HTML Template, Default Single-File HTML Template, or Default PDF Template, depending on the output type. To number both chapters and subsections, select the Default Numbered template. You can customize these templates to generate other numbering schemes. For example, to generate unnumbered chapters, delete the rgChapterTitleNumber hole in the rgChapterTitle library template in your report’s main template.

To generate unnumbered chapters and sections in style-sheet-based output, select Unnumbered Chapters and Sections as your report’s style sheet. To number chapters and sections, select Numbered Chapters and Sections as your report’s style sheet. You can generate other numbering schemes by customizing these style sheets.

Customize Word Chapter or Section Title Styles

You can create custom styles in your Word template to change the appearance of chapter or section titles.

  1. In your Word template, define styles for the title prefix (for example, the word Chapter or Section), the title number, and the title text. Name them in the form MyRootPrefix, MyRootNumber, and MyRootText, for example:

    myChapterTitlePrefix

    myChapterTitleNumber

    myChapterTitleText

  2. In the Chapter/Subsection dialog box in Report Explorer, set Style Name to your value for MyRoot, for example myChapterTitle.

    When you generate your report, the MATLAB® Report Generator™ uses your styles instead of the default styles.

Section Title

  • Title: Specifies a title to display in the generated report:

    • Automatic: Automatically generates a title.

    • Custom: Specifies a custom title.

  • Style Name: Specifies the style to use with the chapter or section title. To specify a style:

    1. Set the report’s File format to one of the from template options, for example, Direct PDF (from template).

    2. In the Chapter/Subsection properties dialog box, set Title to Custom.

    3. Set Style Name to Custom.

    4. In the Style Name text box, type a style name.

      To take effect, the style you specify must be defined in the template that you use to generate the report. For Word documents, do not use the built-in styles. If you want to use a built-in style, create your own style based on the built-in style, for example MyHeading1.

      For more information about template styles, see Report Templates.

  • Numbering: Specifies a numbering style for the report:

    • Automatic: Numbers by context.

    • Custom: Allows you to create your own numbering style.

  • Section Type: Shows you in which level a selected section resides.

Insert Anything into Report?

Yes. Chapter or section.

Class

rptgen.cfr_section