defaults object controls the global styling and formatting of your document. All properties are optional — elements without explicit styling inherit from these defaults.
Top-level defaults
| Property | Type | Default | Description |
|---|---|---|---|
fontFamily | string | — | Default font family name. Max: 100 chars. |
fontSize | number | — | Default font size in pt (6–72). |
color | string | — | Default text color in hex (#RGB or #RRGGBB). |
lineHeight | number | — | Default line height multiplier (0.5–3). |
headingNumbering | string | — | Heading numbering format string. See Heading numbering. Max: 20 chars. |
citationStyle | string | — | Citation formatting style. See Citations. |
spacing | object | — | Global spacing defaults per element type. See Spacing. |
styles | object | — | Default styles for specific element types. See Element styles. |
chart | object | — | Default chart color palette. See Chart defaults. |
header | object | — | Global page header. See Header & Footer. |
footer | object | — | Global page footer. See Header & Footer. |
Heading numbering
TheheadingNumbering format string defines automatic numbering for headings. Each character represents the numbering style for one heading level, separated by dots.
1 → 1.1 → 1.1.a for h1 → h2 → h3.
| Character | Style | Example |
|---|---|---|
1 | Numeric | 1, 2, 3… |
a | Lowercase alpha | a, b, c… |
A | Uppercase alpha | A, B, C… |
i | Lowercase roman | i, ii, iii… |
I | Uppercase roman | I, II, III… |
α | Greek lowercase | α, β, γ… |
Spacing
Thespacing object defines default spacing (in pt) before and after each element type. Individual elements can override these via their own spacing property.
Supported element types for spacing
Bothbefore and after accept the same set of keys:
| Key | Applies to |
|---|---|
h1 – h6 | Heading levels 1–6 |
text | Normal paragraphs (type: "text") |
text2 | Secondary text (type: "text2") |
table | Table elements |
list | List elements |
image | Image elements |
qrcode | QR code elements |
chart | Chart elements |
code | Code block elements |
math | Math (LaTeX) elements |
Per-element spacing override
Any element with aspacing property can override the global defaults:
| Property | Type | Description |
|---|---|---|
before | number | Spacing before element in pt (0–100) |
after | number | Spacing after element in pt (0–100) |
Element styles
Thestyles object defines default styling for specific element types. These are applied when an element does not specify its own styling.
Text style (h1–h6, text, text2)
Used forstyles.h1 through styles.h6, styles.text, and styles.text2.
| Property | Type | Description |
|---|---|---|
fontFamily | string | Font family. Max: 100 chars. |
fontSize | number | Font size in pt (6–72). |
fontWeight | string | "normal" or "bold" |
color | string | Text color in hex (#RGB or #RRGGBB). |
align | string | Alignment: "left", "center", "right", "justify" |
pageBreakBefore | boolean | Force a page break before this element type. |
Math style
Used forstyles.math.
| Property | Type | Description |
|---|---|---|
fontFamily | string | Font family. Max: 100 chars. |
fontSize | number | Font size in pt (6–72). |
fontWeight | string | "normal" or "bold" |
color | string | Text color in hex. |
align | string | Alignment: "left", "center", "right" |
renderAsImage | boolean | Render math as image for better compatibility. |
Code style
Used forstyles.code.
| Property | Type | Description |
|---|---|---|
fontFamily | string | Font family. Max: 100 chars. |
fontSize | number | Font size in pt (6–72). |
backgroundColor | string | Background color in hex (#RGB, #RRGGBB, or #RRGGBBAA). |
align | string | Alignment: "left", "center", "right" |
renderAsImage | boolean | Render code block as image via internal render API. |
Table style
Used forstyles.table. Controls borders, header row, data rows, and cell padding.
Table style properties
Table style properties
borders.outer / borders.inner
header
rows
cellPadding
| Property | Type | Description |
|---|---|---|
width | number | Border width in pt (0–10). |
color | string | Border color in hex. |
style | string | "solid", "dashed", or "dotted" |
| Property | Type | Description |
|---|---|---|
backgroundColor | string | Header background color in hex. |
color | string | Header text color in hex. |
fontSize | number | Header font size in pt (6–72). |
fontWeight | string | "normal" or "bold" |
fontStyle | string | "normal" or "italic" |
align | string | "left", "center", or "right" |
| Property | Type | Description |
|---|---|---|
backgroundColor | string | Row background color in hex. |
alternateBackgroundColor | string | Alternate row background color for striped tables. |
color | string | Row text color in hex. |
fontSize | number | Row font size in pt (6–72). |
fontWeight | string | "normal" or "bold" |
fontStyle | string | "normal" or "italic" |
align | string | "left", "center", or "right" |
| Property | Type | Description |
|---|---|---|
top | number | Top padding in pt (0–50). |
right | number | Right padding in pt (0–50). |
bottom | number | Bottom padding in pt (0–50). |
left | number | Left padding in pt (0–50). |
Figure caption style
Used forstyles.figureCaption. Controls captions on images and charts.
| Property | Type | Default | Description |
|---|---|---|---|
disable | boolean | false | Disable figure captions globally. |
fontFamily | string | — | Font family. Max: 100 chars. |
fontSize | number | — | Font size in pt (6–72). |
fontWeight | string | — | "normal" or "bold" |
fontStyle | string | "italic" | "normal" or "italic" |
color | string | — | Text color in hex. |
align | string | "center" | "left", "center", or "right" |
prefix | string | "Figure" | Prefix for auto-numbering (e.g., "Figure", "Abb.", "Fig."). Max: 50 chars. |
spacingBefore | number | 4 | Spacing between image/chart and caption in pt (0–50). |
Table caption style
Used forstyles.tableCaption. Controls captions on tables.
| Property | Type | Default | Description |
|---|---|---|---|
disable | boolean | false | Disable table captions globally. |
fontFamily | string | — | Font family. Max: 100 chars. |
fontSize | number | — | Font size in pt (6–72). |
fontWeight | string | — | "normal" or "bold" |
fontStyle | string | "italic" | "normal" or "italic" |
color | string | — | Text color in hex. |
align | string | "center" | "left", "center", or "right" |
prefix | string | "Table" | Prefix for auto-numbering (e.g., "Table", "Tabelle", "Tab."). Max: 50 chars. |
spacingAfter | number | 4 | Spacing after caption (before table) in pt (0–50). |
Reference link style
Used forstyles.refLink. Controls the appearance of internal reference links (cross-references to headings, figures, tables).
| Property | Type | Default | Description |
|---|---|---|---|
bold | boolean | — | Bold text. |
italic | boolean | — | Italic text. |
underline | boolean | true | Underline text. |
color | string | #0000FF | Link color in hex. |
List of Abbreviations style
Used forstyles.listOfAbbreviations. See Abbreviations — Defaults.
Bibliography style
Used forstyles.bibliography. See Citations — Defaults.
Chart defaults
Default color palette for chart datasets.| Property | Type | Description |
|---|---|---|
colors | string[] | Array of hex colors for chart dataset fills. |
borderColors | string[] | Array of hex colors for chart dataset borders. |
Header & Footer
Configure global page headers and footers. Each has three columns (left, center, right) that can contain text or images.
Header/Footer properties
| Property | Type | Default | Description |
|---|---|---|---|
left | string | object | — | Left column content. |
center | string | object | — | Center column content. |
right | string | object | — | Right column content. |
align | string | — | Alignment override: "left", "center", "right", or "distributed". |
excludeFirstPage | boolean | false | Exclude header/footer from the first page. |
align option "distributed" aligns each column to its natural position: left column → left, center column → center, right column → right.
Content types
Each column (left, center, right) accepts one of three formats:
Simple string:
| Property | Type | Description |
|---|---|---|
text | string | Text content. Max: 500 chars. |
fontFamily | string | Font family. Max: 100 chars. |
fontSize | number | Font size in pt (6–72). |
fontWeight | string | "normal" or "bold" |
fontStyle | string | "normal" or "italic" |
color | string | Text color in hex. |
align | string | "left", "center", or "right" |
| Property | Type | Description |
|---|---|---|
type | string | Must be "image" |
src | string | Image URL. Max: 500 chars. |
caption | string | Alt text. Max: 200 chars. |
width | number | Width in px (10–500). |
height | number | Height in px (10–200). |
align | string | "left", "center", or "right" |
Variable substitution (
{{varName}}) works in header/footer text content — both simple strings and rich text content arrays.