Main Content

Text

Format and insert text into report

Description

This component formats and inserts text into the report. For Word and PDF reports, it must have the Paragraph component as its parent.

Properties

  • Text to include in report: Specifies text to include in the report. The specified text can include computed property expressions of the form %<expr> where expr is a MATLAB expression that evaluates to a string when the report is generated. For example, the text “This report was generated on %<date>.” inserts the specified text in the report with %<date> replaced by the date on which the report is generated.

  • Style Name: Specifies the style to use with the text for reports whose output format is one of the from template types, for example, Direct PDF (from template). By default, this component's content inherits the style of the paragraph in which it is inserted. To override the paragraph style, specify another style defined in the report template. To specify another style:

    1. Set Style Name to Specify.

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

      The custom style you specify must be a span style for HTML and PDF reports or a character or linked paragraph/character style for Word reports defined in the template that you use to generate the report. For more information about template styles, see Report Templates.

In Microsoft® Word, paragraph styles and text styles applied using a named style can interact when you apply both to the same text. This interaction occurs for formatting properties that paragraphs and text have in common, such as bold, italic, and underline.

For example, you apply the paragraph style MyStyle to a paragraph and that MyStyle specifies bold formatting. Then, you apply a text style named BoldStyle to text in the paragraph. The text formatted with BoldStyle toggles the paragraph style bold off for that text. To ensure the text is bold, create a text style that does not use bold but has the other properties you want to apply to text in that type of paragraph.

Style

  • Bold: Makes the text bold.

  • Italic: Makes the text italic.

  • Underline: Underlines the text.

  • Strikethrough: Strikes through the text.

  • Subscript: Formats text as a subscript, in a smaller font than the other text, set slightly below the other text.

  • Superscript: Formats text as a superscript, in a smaller font than the other text, set slightly above the other text.

  • Preserve white space: Preserves sequences of white spaces in the text. If you select Preserve white space, the white space is preserved in all child components of that paragraph. If you do not select Preserve white space, multiple spaces are reduced to a single space. This option applies only to reports with an output type of (from template), such as Direct PDF (from template). The option does not appear for other output types.

    Note

    These format options override any corresponding formats defined in the custom style you specify. For example, selecting Bold makes the text bold, even if the specified style uses regular weight text.

    To preserve white space in a PDF report, you must select this option at the paragraph level. PDF does not support preserving white space for selected Text children of a Paragraph component.

  • Color: Specifies the color of the text.

    • Select a color from the list of colors.

    • Enter a hexadecimal RGB value as #RRGGBB. For example, #0000ff is a shade of blue.

    • Enter %<expr>, where expr is a MATLAB® expression that evaluates to a color name or a hexadecimal RGB value.

Note

These format options override any corresponding formats defined in the custom style you specify. For example, selecting Bold makes the text bold, even if the specified style uses regular weight text.

Insert Anything into Report?

Yes. Text.

Class

rptgen.cfr_text