> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autype.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Defaults

> Global styling defaults: fonts, colors, spacing, element styles, header/footer, and more

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

```json theme={null}
{
  "defaults": {
    "fontFamily": "Arial",
    "fontSize": 12,
    "color": "#000000",
    "lineHeight": 1.15,
    "headingNumbering": "1.1.1",
    "citationStyle": "apa7",
    "spacing": { ... },
    "styles": { ... },
    "chart": { ... },
    "header": { ... },
    "footer": { ... }
  }
}
```

| 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](#heading-numbering). Max: 20 chars.      |
| `citationStyle`    | string | —       | Citation formatting style. See [Citations](/api-reference/json-syntax/citations#citation-styles). |
| `spacing`          | object | —       | Global spacing defaults per element type. See [Spacing](#spacing).                                |
| `styles`           | object | —       | Default styles for specific element types. See [Element styles](#element-styles).                 |
| `chart`            | object | —       | Default chart color palette. See [Chart defaults](#chart-defaults).                               |
| `header`           | object | —       | Global page header. See [Header & Footer](#header--footer).                                       |
| `footer`           | object | —       | Global page footer. See [Header & Footer](#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.

```json theme={null}
{ "headingNumbering": "1.1.a" }
```

This produces: `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 | α, β, γ…    |

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.

```json theme={null}
{
  "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:

| 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              |

All values are in pt, range 0–100.

### Per-element spacing override

Any element with a `spacing` property can override the global defaults:

```json theme={null}
{ "type": "h1", "text": "Title", "spacing": { "before": 0, "after": 24 } }
```

| Property | Type   | Description                          |
| -------- | ------ | ------------------------------------ |
| `before` | number | Spacing before element in pt (0–100) |
| `after`  | number | Spacing 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.

```json theme={null}
{
  "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`.

| 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 for `styles.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 for `styles.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 for `styles.table`. Controls borders, header row, data rows, and cell padding.

```json theme={null}
{
  "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 }
      }
    }
  }
}
```

<Accordion title="Table style properties">
  **borders.outer / borders.inner**

  | Property | Type   | Description                          |
  | -------- | ------ | ------------------------------------ |
  | `width`  | number | Border width in pt (0–10).           |
  | `color`  | string | Border color in hex.                 |
  | `style`  | string | `"solid"`, `"dashed"`, or `"dotted"` |

  **header**

  | 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"` |

  **rows**

  | 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"`                 |

  **cellPadding**

  | 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).   |
</Accordion>

### Figure caption style

Used for `styles.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 for `styles.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 for `styles.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 for `styles.listOfAbbreviations`. See [Abbreviations — Defaults](/api-reference/json-syntax/abbreviations#defaults-for-abbreviations).

### Bibliography style

Used for `styles.bibliography`. See [Citations — Defaults](/api-reference/json-syntax/citations#defaults-for-citations).

## Chart defaults

Default color palette for chart datasets.

```json theme={null}
{
  "defaults": {
    "chart": {
      "colors": ["#4BC0C0", "#FF6384", "#36A2EB", "#FFCE56", "#9966FF"],
      "borderColors": ["#4BC0C0", "#FF6384", "#36A2EB", "#FFCE56", "#9966FF"]
    }
  }
}
```

| 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.

```json theme={null}
{
  "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

| 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.                               |

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:**

```json theme={null}
{ "left": "Page {{pageNumber}}" }
```

**Rich text object:**

```json theme={null}
{
  "left": {
    "type": "text",
    "content": [
      { "text": "Acme Inc", "fontWeight": "bold", "fontSize": 10 },
      { "text": " — Confidential", "fontStyle": "italic", "color": "#999999" }
    ]
  }
}
```

Rich text content items:

| 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"` |

**Image object:**

```json theme={null}
{
  "center": {
    "type": "image",
    "src": "https://example.com/logo.png",
    "caption": "Logo",
    "width": 100,
    "height": 40,
    "align": "center"
  }
}
```

| 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"` |

<Info>
  Variable substitution (`{{varName}}`) works in header/footer text content — both simple strings and rich text `content` arrays.
</Info>

## Complete example

```json theme={null}
{
  "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
    }
  }
}
```
