How styles work
Styles are defined in the document’sdefaults.styles object. Each element type has its own style configuration. When you render a document, the renderer applies these styles to all matching elements.
Inline style overrides (e.g., <h1 align="center">) take precedence over defaults.
Style categories
Text styles
| Style key | Applies to | Key properties |
|---|---|---|
heading1 – heading6 | Headings h1–h6 | fontFamily, fontSize, fontWeight, color, align, spacing |
text | Standard paragraphs | fontFamily, fontSize, fontWeight, fontStyle, color, align, spacing, lineSpacing |
text2 | Secondary paragraphs (| text) | Same as text |
Caption styles
Captions are automatically generated for images, charts, and tables that have a caption or alt text.Figure captions
Applies to images and charts with captions. Configured underdefaults.styles.figureCaption:
| Property | Values | Default | Description |
|---|---|---|---|
disable | true, false | false | Disable figure captions globally |
prefix | String | "Figure" | Prefix for auto-numbering (e.g., "Figure", "Abb.", "Fig.") |
fontFamily | Font name | (inherits) | Caption font family |
fontSize | Number (pt) | (smaller than body) | Caption font size |
fontWeight | normal, bold | normal | Caption font weight |
fontStyle | normal, italic | italic | Caption font style |
color | Hex color | (inherits) | Caption text color |
align | left, center, right | center | Caption alignment |
spacingBefore | Number (pt) | 4 | Space between image/chart and caption |
"Figure") is configurable — set it to "Abb." for German documents or "Fig." for abbreviated English.
Table captions
Applies to tables with thecaption attribute. Configured under defaults.styles.tableCaption:
| Property | Values | Default | Description |
|---|---|---|---|
disable | true, false | false | Disable table captions globally |
prefix | String | "Table" | Prefix for auto-numbering (e.g., "Table", "Tabelle", "Tab.") |
fontFamily | Font name | (inherits) | Caption font family |
fontSize | Number (pt) | (smaller than body) | Caption font size |
fontWeight | normal, bold | normal | Caption font weight |
fontStyle | normal, italic | italic | Caption font style |
color | Hex color | (inherits) | Caption text color |
align | left, center, right | center | Caption alignment |
spacingAfter | Number (pt) | 4 | Space between caption and table |
Reference link style
Controls the appearance of internal cross-references. Configured underdefaults.styles.refLink:
| Property | Values | Default | Description |
|---|---|---|---|
bold | true, false | false | Bold reference links |
italic | true, false | false | Italic reference links |
underline | true, false | true | Underline reference links |
color | Hex color | #0000FF | Reference link color |
List of Abbreviations style
Controls how the abbreviation list is rendered. Configured underdefaults.styles.listOfAbbreviations:
| Property | Values | Default | Description |
|---|---|---|---|
fontFamily | Font name | (inherits) | Font family |
fontSize | Number (pt) | (inherits) | Font size |
fontWeight | normal, bold | normal | Font weight |
