Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Starter Template

If you just want to get started, you can download this template that showcases most features available:

View file
nameParagraph_Starter_Template.docx

Structure

All paragraph styles are defined within a table

  • having a header row (ignored), and

  • in the leftmost column are the names of the referenced word styles

  • further columns are ignored and can be used to add examples or any other supporting information.

Name

Example

P_Header_1

P_Header_1

P_Header_2

P_Header_2

Behavior

Paragraph styles define a reference to word styles that can then be used in various nodes (such as paragraph nodes and section nodes).

...

  • They allow the definition of a default style that is used whenever no style is given.

It is a table with a header row and in the leftmost column is the name of the referenced word style. Here is an example of what this looks like:

...

All columns next to the leftmost columns are ignored and can be used to add examples or any other supporting information.

  • Usually paragraph nodes are produced as plaintext with an optional style applied to them.

  • If the content is surrounded with <html></html> though, it is produced as HTML.

Paragraph nodes

The logic for using a style in paragraph nodes is as follows:

...

  1. If a style is specified, use it

  2. If a style is specified but it doesn’t exist, generate a warning and use the style “Header x” where x is the level of the section node in the abstract report tree

  3. If no style is specified, use the default one. If no default style exists, use the style “Header x” where x is the level of the section node in the abstract report tree

  4. If the special “none” style is specified, use the “Header x” algorithm for finding a style.

Info

Important

The “Header x” logic for setting the style based on the level of the section node works with the levels in the tree, not the section nodes themselves. This means that the first section node has to be the root of the abstract report, the second level the child of the root and so forth. If there is a NoOpNode first and after that a section node, this rule is not applied.

Metadata

The metadata comment must be set on the referenced style in the table.

...

The noStyle option defines the marker style that can be used to override the default style and use no style at all:

...

Examples

Example 1: Showing a simple case for paragraph styles

View file
nameabstract-report-paragraph_simple.json
View file
nameoutput-paragraph_simple.docx
View file
nametemplate-paragraph_simple.docx

Example 2: Showing how the style based on the level of the section is used

View file
nameabstract-report-paragraph_section_levels.json
View file
nametemplate-paragraph_section_levels.docx
View file
nameoutput-paragraph_section_levels.docx