Skip to content

Components

This page provides an overview of all OpenReport components, including examples and details on required and optional properties. Full functionality per component is available at:

  1. Text
  2. Heading
  3. Figure
  4. Table
  5. Caption
  6. Bullet list

Back to homepage

Text

Overview

The "text" instance initiates a paragraph in the output document. Separate text parts can be parameterized using \command{text} format, for example \textit{Hello world!}. Parameters can overlap, for example \textbf{\textit{Hello world!}}. For the whole list of available parameterization please check the full documentation.

Example

document:
  name: document.docx
  structure:
    - text:
        body: Hello World!

Required properties

The text should be specified either under "body" property:

document:
  name: document.docx
  structure:
    - text:
        body: Hello World!
Or using "source" instance:
- text:
    source:
      output: text
      source_type: local
      location: "input/text_example.txt"
Full source functionality is available at Components generation.

Optional properties

- text: 
    alignment: 
    bold:
    colour:
    first_line_indent:
    font:
    highlight_color:
    italic:
    keep_together:
    keep_with_next:
    left_indent:
    line_spacing:
    line_spacing_rule:
    page_break_before:
    right_indent:
    size:
    space_after:
    space_before:
    underline:
The full formatting functionality is available at Text properties.

Back to homepage


Heading

Overview

The "heading" instance initiates a paragraph with Heading style applied in the output document. The "level" property specifies the heading's level.

Example

document:
  name: document.docx
  structure:
    - heading: 
        body: Heading 1
        level: 1
    - heading: 
        body: SubHeading 1
        level: 2

Required properties

The heading text should be specified either under "body" property:

document:
  name: document.docx
  structure:
    - heading: 
        body: Heading 1
        level: 1

Or using "source" instance:

- heading:
    source:
      output: text
      source_type: local
      location: "input/heading_example.txt"
    level: 2
Full source functionality is available at Components generation.

Optional properties

- heading: 
    alignment: 
    bold:
    colour:
    first_line_indent:
    font:
    highlight_color:
    italic:
    keep_together:
    keep_with_next:
    left_indent:
    line_spacing:
    line_spacing_rule:
    page_break_before:
    right_indent:
    size:
    space_after:
    space_before:
    underline:
The full formatting functionality is available at Heading properties.

Back to homepage


Table

Overview

The "table" instance initiates a table in the output document.

Example

document:
  name: document.docx
  structure:
    - table:
        source:
          output: table
          source_type: local
          location: 'input/table_1.xlsx'

Required properties

The source of table should be specified using "source" instance:

document:
  name: document.docx
  structure:
    - table:
        source:
          output: table
          source_type: local
          location: 'input/table_1.xlsx'
Full source functionality is available at Components generation.

Optional properties

- table: 
    border_colour:
    caption:
    cells:
    table_font:
    table_font_size:
    table_style:
    tight_fit:
    top_row_colour:

The full formatting functionality is available at Table properties.

Back to homepage


Figure

Overview

The "figure" instance initiates a figure in the output document.

Example

document:
  name: document.docx
  structure:
    - figure:
        source:
          output: figure
          source_type: local
          location: 'input/figure_1.jpg'

Required properties

The source of figure should be specified using "source" instance:

document:
  name: document.docx
  structure:
    - figure:
        source:
          output: figure
          source_type: local
          location: 'input/figure_1.jpg'
Full source functionality is available at Components generation.

Optional properties

- figure: 
    alignment:
    caption:
    figure_width:

The full formatting functionality is available at Figure properties.

Back to homepage


Caption

Overview

The "caption" instance initiates a paragraph with Caption style applied in the output document. The "caption" can be used under "figure" or "table" instances. The caption text should be specified either under "body" property or using "source" instance.

Example

document:
  name: document.docx
  structure:
    - table:
        source:
          output: table
          source_type: local
          location: 'input/table_1.xlsx'
        caption:
          body: Caption for Table 1.
    - figure:
        source:
          output: figure
          source_type: local
          location: 'input/figure_1.jpg'
        caption:
          source:
            output: text
            source_type: local
            location: 'input/caption_text.txt'
Full source functionality is available at Components generation.

Required properties

The caption text should be specified either under "body" property:

document:
  name: document.docx
  structure:
    - figure:
        source:
          output: figure
          source_type: local
          location: 'input/figure_1.jpg'
        caption:
          body: Caption for Figure 1.
Or using "source" instance:
- figure:
    source: # this is the source of the figure
      output: figure
      source_type: local
      location: 'input/figure_1.jpg'
    caption:
      source: # this is the source of the caption
        output: text
        source_type: local
        location: "input/caption_example.txt"
Full source functionality is available at Components generation.

Optional properties

- caption: 
    alignment: 
    bold:
    colour:
    first_line_indent:
    font:
    highlight_color:
    italic:
    keep_together:
    keep_with_next:
    left_indent:
    line_spacing:
    line_spacing_rule:
    page_break_before:
    right_indent:
    size:
    space_after:
    space_before:
    underline:
The full formatting functionality is available at Caption properties.

Back to homepage


Mathematical expression

Overview

The "math_expression" instance initiates an equation in the output document. The equation should be specified using LaTeX's features for typesetting mathematics. The "math_expression" provides the display math mode, meaning expressions are not part of a paragraph and put on separate lines. The inline math mode allows to write formulas that are part of a "text", "heading" or "caption" instances. For the inline mode the mathematical expressions should be written within ${...}$ delimiters, for example 'This means: ${x^2 + y^2 = z^2}$'.

Example

document:
  name: document.docx
  structure:
    - math_expression:
        body: >-
          \begin{align*}
          \left(x\frac{L}{n\pi}\sin\frac{n\pi x}{L} + \frac{L^2}{n^2\pi^2}\cos\frac{n\pi x}{L}\right)\bigg|_{0}^{L/2} \\
          = \left(\frac{L^2}{2n\pi}\sin\frac{n\pi }{2} + \frac{L^2}{n^2\pi^2}\cos\frac{n\pi }{2}\right) - \left(\frac{L^2}{n^2\pi^2}\right)
          \end{align*}

Required properties

Mathematical expression should be specified either under "body" property:

document:
  name: document.docx
  structure:
    - math_expression:
        body: >-
          x^2 + y^2 = z^2

Back to homepage


Bullet list

Overview

The "bullet_list" instance initiates a bulleted or numbered list in the output document. The "items" instance lists all object instances applicable for this bullet list. Optional instances for "items": "text" and "math_expression"

Example

- bullet_list:
    bullet_list_style: List Bullet
    items:
      - text:
          body: Bullet point 1
      - text:
          body: Bullet point 2

Required properties

The Bullet list should be specified using "bullet_list_style" and "items":

- bullet_list:
    bullet_list_style: List Number
    items:
      - text:
          body: Bullet point 1
      - math_expression:
          body: >-
            x^2 + y^2 = z^2

The full formatting functionality is available at Bullet list properties.

Back to homepage


External Word file

Overview

The "word_file" instance allows to add contents and formatting of an external Microsoft Word document to the output document. This is particularly useful for addition of any non-standard objects like shapes, diagrams or cover page.

Example

document:
  name: document.docx
  structure:
    - heading: 
        body: Contents before external word file
        level: 1
    - word_file:
        location: 'input/external_word_file.docx'
    - heading: 
        body: Contents after external word file
        level: 1

Required properties

The External Word file should be specified using "location" instance:

document:
  name: document.docx
  structure:
    - word_file:
        location: 'input/external_word_file.docx'

Back to homepage


Table of contents

Overview

The "table_of_contents" instance generates a table of contents in the "document" based on all "heading" instances.

Example

document:
  name: document.docx
  structure:
    - table_of_contents:
    - heading: 
        body: Heading 1
        level: 1
    - heading: 
        body: SubHeading 1
        level: 2
    - heading: 
        body: SubHeading 2
        level: 2

Back to homepage


List of figures

Overview

The "list_of_figures" instance generates a list of figures in the "document" based on all "figure" instances.

Example

document:
  name: document.docx
  structure:
    - figure:
        source:
          output: figure
          source_type: local
          location: 'input/figure_1.jpg'
        caption:
          body: Caption for Figure 1.
    - figure:
        source:
          output: figure
          source_type: local
          location: 'input/figure_2.jpg'
        caption:
          body: Caption for Figure 2.
    - list_of_figures:

Back to homepage


List of tables

Overview

The "list_of_tables" instance generates a list of tables in the "document" based on all "table" instances. "Table #: caption" is used as a name of a table, where caption is specified under "table" instance.

Example

document:
  name: document.docx
  structure:
    - table:
        source:
          output: table
          source_type: local
          location: 'input/table_1.xlsx'
        caption:
          body: Caption for Table 1.
    - table:
        source:
          output: table
          source_type: local
          location: 'input/table_2.xlsx'
        caption:
          body: Caption for Table 2.
    - list_of_tables:
Continue to components generation

Back to top

Back to homepage