Skip to main content
The 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

{
  "defaults": {
    "fontFamily": "Arial",
    "fontSize": 12,
    "color": "#000000",
    "lineHeight": 1.15,
    "headingNumbering": "1.1.1",
    "citationStyle": "apa7",
    "spacing": { ... },
    "styles": { ... },
    "chart": { ... },
    "header": { ... },
    "footer": { ... }
  }
}
PropertyTypeDefaultDescription
fontFamilystringDefault font family name. Max: 100 chars.
fontSizenumberDefault font size in pt (6–72).
colorstringDefault text color in hex (#RGB or #RRGGBB).
lineHeightnumberDefault line height multiplier (0.5–3).
headingNumberingstringHeading numbering format string. See Heading numbering. Max: 20 chars.
citationStylestringCitation formatting style. See Citations.
spacingobjectGlobal spacing defaults per element type. See Spacing.
stylesobjectDefault styles for specific element types. See Element styles.
chartobjectDefault chart color palette. See Chart defaults.
headerobjectGlobal page header. See Header & Footer.
footerobjectGlobal page footer. See Header & Footer.

Heading numbering

The headingNumbering format string defines automatic numbering for headings. Each character represents the numbering style for one heading level, separated by dots.
{ "headingNumbering": "1.1.a" }
This produces: 11.11.1.a for h1 → h2 → h3.
CharacterStyleExample
1Numeric1, 2, 3…
aLowercase alphaa, b, c…
AUppercase alphaA, B, C…
iLowercase romani, ii, iii…
IUppercase romanI, II, III…
αGreek lowercaseα, β, γ…
Set to an empty string or omit to disable heading numbering.

Spacing

The spacing object defines default spacing (in pt) before and after each element type. Individual elements can override these via their own spacing property.
{
  "defaults": {
    "spacing": {
      "before": {
        "h1": 24,
        "h2": 18,
        "h3": 14,
        "text": 0,
        "table": 12,
        "list": 8,
        "image": 12,
        "code": 12,
        "math": 8
      },
      "after": {
        "h1": 12,
        "h2": 8,
        "h3": 6,
        "text": 6,
        "table": 12,
        "list": 8,
        "image": 12,
        "code": 12,
        "math": 8
      }
    }
  }
}

Supported element types for spacing

Both before and after accept the same set of keys:
KeyApplies to
h1h6Heading levels 1–6
textNormal paragraphs (type: "text")
text2Secondary text (type: "text2")
tableTable elements
listList elements
imageImage elements
qrcodeQR code elements
chartChart elements
codeCode block elements
mathMath (LaTeX) elements
All values are in pt, range 0–100.

Per-element spacing override

Any element with a spacing property can override the global defaults:
{ "type": "h1", "text": "Title", "spacing": { "before": 0, "after": 24 } }
PropertyTypeDescription
beforenumberSpacing before element in pt (0–100)
afternumberSpacing after element in pt (0–100)

Element styles

The styles object defines default styling for specific element types. These are applied when an element does not specify its own styling.
{
  "defaults": {
    "styles": {
      "h1": { "fontSize": 24, "fontWeight": "bold", "color": "#111111" },
      "h2": { "fontSize": 18, "fontWeight": "bold" },
      "h3": { "fontSize": 14, "fontWeight": "bold" },
      "text": { "fontSize": 11, "align": "justify" },
      "text2": { "fontSize": 9, "color": "#666666" },
      "table": { ... },
      "math": { ... },
      "code": { ... },
      "figureCaption": { ... },
      "tableCaption": { ... },
      "refLink": { ... },
      "listOfAbbreviations": { ... },
      "bibliography": { ... }
    }
  }
}

Text style (h1–h6, text, text2)

Used for styles.h1 through styles.h6, styles.text, and styles.text2.
PropertyTypeDescription
fontFamilystringFont family. Max: 100 chars.
fontSizenumberFont size in pt (6–72).
fontWeightstring"normal" or "bold"
colorstringText color in hex (#RGB or #RRGGBB).
alignstringAlignment: "left", "center", "right", "justify"
pageBreakBeforebooleanForce a page break before this element type.

Math style

Used for styles.math.
PropertyTypeDescription
fontFamilystringFont family. Max: 100 chars.
fontSizenumberFont size in pt (6–72).
fontWeightstring"normal" or "bold"
colorstringText color in hex.
alignstringAlignment: "left", "center", "right"
renderAsImagebooleanRender math as image for better compatibility.

Code style

Used for styles.code.
PropertyTypeDescription
fontFamilystringFont family. Max: 100 chars.
fontSizenumberFont size in pt (6–72).
backgroundColorstringBackground color in hex (#RGB, #RRGGBB, or #RRGGBBAA).
alignstringAlignment: "left", "center", "right"
renderAsImagebooleanRender code block as image via internal render API.

Table style

Used for styles.table. Controls borders, header row, data rows, and cell padding.
{
  "defaults": {
    "styles": {
      "table": {
        "borders": {
          "outer": { "width": 1, "color": "#000000", "style": "solid" },
          "inner": { "width": 0.5, "color": "#CCCCCC", "style": "solid" }
        },
        "header": {
          "backgroundColor": "#F0F0F0",
          "color": "#000000",
          "fontSize": 11,
          "fontWeight": "bold",
          "align": "left"
        },
        "rows": {
          "backgroundColor": "#FFFFFF",
          "alternateBackgroundColor": "#F9F9F9",
          "color": "#333333",
          "fontSize": 10
        },
        "cellPadding": { "top": 4, "right": 6, "bottom": 4, "left": 6 }
      }
    }
  }
}
borders.outer / borders.inner
PropertyTypeDescription
widthnumberBorder width in pt (0–10).
colorstringBorder color in hex.
stylestring"solid", "dashed", or "dotted"
header
PropertyTypeDescription
backgroundColorstringHeader background color in hex.
colorstringHeader text color in hex.
fontSizenumberHeader font size in pt (6–72).
fontWeightstring"normal" or "bold"
fontStylestring"normal" or "italic"
alignstring"left", "center", or "right"
rows
PropertyTypeDescription
backgroundColorstringRow background color in hex.
alternateBackgroundColorstringAlternate row background color for striped tables.
colorstringRow text color in hex.
fontSizenumberRow font size in pt (6–72).
fontWeightstring"normal" or "bold"
fontStylestring"normal" or "italic"
alignstring"left", "center", or "right"
cellPadding
PropertyTypeDescription
topnumberTop padding in pt (0–50).
rightnumberRight padding in pt (0–50).
bottomnumberBottom padding in pt (0–50).
leftnumberLeft padding in pt (0–50).

Figure caption style

Used for styles.figureCaption. Controls captions on images and charts.
PropertyTypeDefaultDescription
disablebooleanfalseDisable figure captions globally.
fontFamilystringFont family. Max: 100 chars.
fontSizenumberFont size in pt (6–72).
fontWeightstring"normal" or "bold"
fontStylestring"italic""normal" or "italic"
colorstringText color in hex.
alignstring"center""left", "center", or "right"
prefixstring"Figure"Prefix for auto-numbering (e.g., "Figure", "Abb.", "Fig."). Max: 50 chars.
spacingBeforenumber4Spacing between image/chart and caption in pt (0–50).

Table caption style

Used for styles.tableCaption. Controls captions on tables.
PropertyTypeDefaultDescription
disablebooleanfalseDisable table captions globally.
fontFamilystringFont family. Max: 100 chars.
fontSizenumberFont size in pt (6–72).
fontWeightstring"normal" or "bold"
fontStylestring"italic""normal" or "italic"
colorstringText color in hex.
alignstring"center""left", "center", or "right"
prefixstring"Table"Prefix for auto-numbering (e.g., "Table", "Tabelle", "Tab."). Max: 50 chars.
spacingAfternumber4Spacing after caption (before table) in pt (0–50).
Used for styles.refLink. Controls the appearance of internal reference links (cross-references to headings, figures, tables).
PropertyTypeDefaultDescription
boldbooleanBold text.
italicbooleanItalic text.
underlinebooleantrueUnderline text.
colorstring#0000FFLink color in hex.

List of Abbreviations style

Used for styles.listOfAbbreviations. See Abbreviations — Defaults.

Bibliography style

Used for styles.bibliography. See Citations — Defaults.

Chart defaults

Default color palette for chart datasets.
{
  "defaults": {
    "chart": {
      "colors": ["#4BC0C0", "#FF6384", "#36A2EB", "#FFCE56", "#9966FF"],
      "borderColors": ["#4BC0C0", "#FF6384", "#36A2EB", "#FFCE56", "#9966FF"]
    }
  }
}
PropertyTypeDescription
colorsstring[]Array of hex colors for chart dataset fills.
borderColorsstring[]Array of hex colors for chart dataset borders.
Configure global page headers and footers. Each has three columns (left, center, right) that can contain text or images.
{
  "defaults": {
    "header": {
      "left": "Acme Inc",
      "center": { "type": "image", "src": "https://example.com/logo.png", "width": 80, "height": 30 },
      "right": "Confidential",
      "align": "distributed",
      "excludeFirstPage": true
    },
    "footer": {
      "left": "{{invoiceDate}}",
      "center": "",
      "right": "Page {{pageNumber}} of {{totalPages}}",
      "excludeFirstPage": false
    }
  }
}

Header/Footer properties

PropertyTypeDefaultDescription
leftstring | objectLeft column content.
centerstring | objectCenter column content.
rightstring | objectRight column content.
alignstringAlignment override: "left", "center", "right", or "distributed".
excludeFirstPagebooleanfalseExclude header/footer from the first page.
The 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:
{ "left": "Page {{pageNumber}}" }
Rich text object:
{
  "left": {
    "type": "text",
    "content": [
      { "text": "Acme Inc", "fontWeight": "bold", "fontSize": 10 },
      { "text": " — Confidential", "fontStyle": "italic", "color": "#999999" }
    ]
  }
}
Rich text content items:
PropertyTypeDescription
textstringText content. Max: 500 chars.
fontFamilystringFont family. Max: 100 chars.
fontSizenumberFont size in pt (6–72).
fontWeightstring"normal" or "bold"
fontStylestring"normal" or "italic"
colorstringText color in hex.
alignstring"left", "center", or "right"
Image object:
{
  "center": {
    "type": "image",
    "src": "https://example.com/logo.png",
    "caption": "Logo",
    "width": 100,
    "height": 40,
    "align": "center"
  }
}
PropertyTypeDescription
typestringMust be "image"
srcstringImage URL. Max: 500 chars.
captionstringAlt text. Max: 200 chars.
widthnumberWidth in px (10–500).
heightnumberHeight in px (10–200).
alignstring"left", "center", or "right"
Variable substitution ({{varName}}) works in header/footer text content — both simple strings and rich text content arrays.

Complete example

{
  "defaults": {
    "fontFamily": "Arial",
    "fontSize": 11,
    "color": "#333333",
    "lineHeight": 1.15,
    "headingNumbering": "1.1.1",
    "citationStyle": "apa7",
    "spacing": {
      "before": { "h1": 24, "h2": 16, "h3": 12, "text": 0, "table": 10 },
      "after": { "h1": 10, "h2": 8, "h3": 6, "text": 6, "table": 10 }
    },
    "styles": {
      "h1": { "fontSize": 22, "fontWeight": "bold", "color": "#111111", "pageBreakBefore": true },
      "h2": { "fontSize": 16, "fontWeight": "bold" },
      "h3": { "fontSize": 13, "fontWeight": "bold" },
      "text2": { "fontSize": 9, "color": "#666666" },
      "table": {
        "borders": {
          "outer": { "width": 1, "color": "#000000" },
          "inner": { "width": 0.5, "color": "#DDDDDD" }
        },
        "header": { "backgroundColor": "#F0F0F0", "fontWeight": "bold" },
        "rows": { "alternateBackgroundColor": "#FAFAFA" },
        "cellPadding": { "top": 4, "right": 6, "bottom": 4, "left": 6 }
      },
      "figureCaption": { "fontSize": 9, "fontStyle": "italic", "prefix": "Fig." },
      "tableCaption": { "fontSize": 9, "fontStyle": "italic", "prefix": "Tab." },
      "refLink": { "color": "#0066CC", "underline": true }
    },
    "chart": {
      "colors": ["#4BC0C0", "#FF6384", "#36A2EB", "#FFCE56"]
    },
    "header": {
      "left": "Acme Inc",
      "right": "Confidential",
      "excludeFirstPage": true
    },
    "footer": {
      "right": "Page {{pageNumber}} of {{totalPages}}",
      "excludeFirstPage": false
    }
  }
}