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

# Variables

> Inline and block-level variables, built-in variables for headers/footers, and advanced date formatting with offsets and timezones.

Variables let you insert dynamic content into your documents. They are replaced with actual values at render time.

## Inline variables

Reference variables inline with double curly braces:

```markdown theme={null}
Dear {{customer.name}}, your order #{{order.id}} is ready.
The total amount is {{totalAmount}} EUR.
```

Variable names must start with a letter and can contain letters, numbers, and underscores. Dot notation (`customer.name`) is supported for nested values.

## Block-level variables

Place a variable reference on its own line to render it as a standalone block:

```markdown theme={null}
{{companyLogo}}
{{signatureBlock}}
{{footerContent}}
```

Block-level variables can contain images, text blocks, or other complex content defined in your document's variable configuration.

## Variable types

Variables support multiple types. The type is determined by the value you provide:

* **Text** — A simple string value (e.g., `"companyName": "Acme Inc"`)
* **Number** — A numeric value (e.g., `"total": { "type": "number", "value": 1250.00 }`)
* **Image** — An image with optional dimensions and alignment
* **List** — An ordered or unordered list
* **Table** — A 2D data table with optional column headers

Number variables are rendered as text when used inline (`{{total}}` becomes `"1250"`). They are especially useful in chart dataset data arrays, where they are automatically resolved to numeric values.

<Info>
  For full details on defining each variable type, see the [JSON Syntax — Variables](/api-reference/json-syntax/variables) reference.
</Info>

***

## Built-in variables (headers & footers)

These variables are automatically available in document headers and footers:

| Variable         | Description               | Example Output |
| ---------------- | ------------------------- | -------------- |
| `{{pageNumber}}` | Current page number       | `1`            |
| `{{totalPages}}` | Total page count          | `99`           |
| `{{date}}`       | Current date (DD.MM.YYYY) | `02.02.2026`   |

***

## Date variable formatting

The `{{date}}` variable supports custom formatting, date manipulation, and timezone offsets.

### Syntax

```
{{date}}                          → Default format (DD.MM.YYYY)
{{date/FORMAT}}                   → Custom format
{{date/FORMAT/OFFSET}}            → With date manipulation
{{date/FORMAT/OFFSET/TIMEZONE}}   → With timezone offset
```

### Format tokens

| Token  | Description      | Example  |
| ------ | ---------------- | -------- |
| `YYYY` | 4-digit year     | 2026     |
| `YY`   | 2-digit year     | 26       |
| `MMMM` | Full month name  | February |
| `MMM`  | Short month name | Feb      |
| `MM`   | 2-digit month    | 02       |
| `M`    | 1-2 digit month  | 2        |
| `dddd` | Full weekday     | Sunday   |
| `ddd`  | Short weekday    | Sun      |
| `DD`   | 2-digit day      | 02       |
| `D`    | 1-2 digit day    | 2        |
| `HH`   | 24-hour hour     | 14       |
| `mm`   | Minutes          | 35       |

### Format presets

Instead of building a format string, use a preset name:

| Preset      | Equivalent Format  | Example          |
| ----------- | ------------------ | ---------------- |
| `iso`       | `YYYY-MM-DD`       | 2026-02-02       |
| `time`      | `HH:mm`            | 14:35            |
| `datetime`  | `DD.MM.YYYY HH:mm` | 02.02.2026 14:35 |
| `long`      | `D. MMMM YYYY`     | 2. February 2026 |
| `monthYear` | `MMMM YYYY`        | February 2026    |

### Date offset (manipulation)

Shift the date forward or backward:

| Offset   | Description         |
| -------- | ------------------- |
| `+1d`    | Tomorrow            |
| `-7d`    | 7 days ago          |
| `+1m`    | Next month          |
| `-1y`    | Last year           |
| `+2h`    | 2 hours from now    |
| `+30min` | 30 minutes from now |

### Timezone offset

Specify a UTC offset in `+HH:mm` or `-HH:mm` format:

```markdown theme={null}
{{date/HH:mm//+01:00}}           → Time in CET
{{date/datetime/+7d/+02:00}}     → Next week, CEST
```

<Note>
  When using a timezone offset without a date offset, leave the offset slot empty with double slashes: `{{date/FORMAT//TIMEZONE}}`.
</Note>

### Examples

```markdown theme={null}
{{date/DD.MM.YYYY}}              → 02.02.2026
{{date/YYYY-MM-DD}}              → 2026-02-02
{{date/D. MMMM YYYY}}           → 2. February 2026
{{date/iso}}                     → 2026-02-02
{{date/DD.MM.YYYY/+1d}}         → Tomorrow's date
{{date/MMMM YYYY/-1y}}          → February 2025
{{date/HH:mm//+01:00}}          → Time in CET
{{date/datetime/+7d/+02:00}}    → Next week, CEST
```
