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

# Indices

> Table of contents, list of figures, list of tables, list of code listings, and other auto-generated indices

Index elements automatically generate structured lists from your document content: a table of contents from headings, a list of figures from captioned images/charts, a list of tables from captioned tables, and a list of code listings from captioned code blocks.

<Info>
  The `listOfAbbreviations` and `bibliography` elements are documented on their own pages: [Abbreviations](/api-reference/json-syntax/abbreviations#list-of-abbreviations-element) and [Citations](/api-reference/json-syntax/citations#bibliography-element).
</Info>

## Table of Contents

Generates an automatic table of contents from headings in the document.

```json theme={null}
{
  "type": "toc",
  "title": "Table of Contents",
  "maxLevel": 3,
  "hyperlink": true
}
```

### Properties

| Property     | Type    | Required | Default | Description                                                                                          |
| ------------ | ------- | -------- | ------- | ---------------------------------------------------------------------------------------------------- |
| `type`       | string  | **Yes**  | —       | Must be `"toc"`                                                                                      |
| `id`         | string  | No       | —       | Unique identifier. Max: 100 chars.                                                                   |
| `title`      | string  | No       | —       | Title displayed above the TOC (e.g., `"Table of Contents"`, `"Inhaltsverzeichnis"`). Max: 200 chars. |
| `maxLevel`   | number  | No       | `3`     | Maximum heading level to include (1–6). E.g., `3` includes h1, h2, h3.                               |
| `hyperlink`  | boolean | No       | `true`  | Make TOC entries clickable links to the corresponding headings.                                      |
| `fontFamily` | string  | No       | —       | Font family for the title. Max: 100 chars.                                                           |
| `fontSize`   | number  | No       | —       | Font size for the title in pt (6–72).                                                                |
| `spacing`    | object  | No       | —       | Spacing override with `before` and `after` in pt (0–100).                                            |

### Example usage

```json theme={null}
{
  "sections": [
    {
      "type": "flow",
      "content": [
        { "type": "toc", "title": "Contents", "maxLevel": 2 },
        { "type": "pageBreak" }
      ]
    },
    {
      "type": "flow",
      "content": [
        { "type": "h1", "text": "Introduction" },
        { "type": "text", "text": "..." },
        { "type": "h2", "text": "Background" },
        { "type": "text", "text": "..." },
        { "type": "h1", "text": "Methods" },
        { "type": "text", "text": "..." }
      ]
    }
  ]
}
```

The TOC will list "Introduction", "Background", and "Methods" with page numbers.

## List of Figures

Generates an automatic list of all images and charts that have a `caption` property.

```json theme={null}
{
  "type": "listOfFigures",
  "title": "List of Figures",
  "tabStyle": "dot"
}
```

### Properties

| Property     | Type   | Required | Default | Description                                                                                            |
| ------------ | ------ | -------- | ------- | ------------------------------------------------------------------------------------------------------ |
| `type`       | string | **Yes**  | —       | Must be `"listOfFigures"`                                                                              |
| `id`         | string | No       | —       | Unique identifier. Max: 100 chars.                                                                     |
| `title`      | string | No       | —       | Title displayed above the list (e.g., `"List of Figures"`, `"Abbildungsverzeichnis"`). Max: 200 chars. |
| `tabStyle`   | string | No       | `"dot"` | Leader style between caption and page number: `"dot"`, `"hyphen"`, `"underscore"`, `"none"`            |
| `fontFamily` | string | No       | —       | Font family for the title. Max: 100 chars.                                                             |
| `fontSize`   | number | No       | —       | Font size for the title in pt (6–72).                                                                  |
| `spacing`    | object | No       | —       | Spacing override with `before` and `after` in pt (0–100).                                              |

<Info>
  Only images and charts with a `caption` property appear in the list of figures. The figure numbering prefix (e.g., "Figure", "Fig.", "Abb.") is controlled by `defaults.styles.figureCaption.prefix`.
</Info>

### Example usage

```json theme={null}
{
  "sections": [{
    "type": "flow",
    "content": [
      { "type": "listOfFigures", "title": "Figures" },
      { "type": "pageBreak" },
      { "type": "h1", "text": "Results" },
      { "type": "image", "src": "https://example.com/chart.png", "caption": "Revenue growth 2024" },
      { "type": "chart", "caption": "User adoption rate", "config": { "type": "line", "data": { "labels": ["Q1", "Q2"], "datasets": [{ "data": [100, 200] }] } } }
    ]
  }]
}
```

## List of Tables

Generates an automatic list of all tables that have a `caption` property.

```json theme={null}
{
  "type": "listOfTables",
  "title": "List of Tables",
  "tabStyle": "dot"
}
```

### Properties

| Property     | Type   | Required | Default | Description                                                                                         |
| ------------ | ------ | -------- | ------- | --------------------------------------------------------------------------------------------------- |
| `type`       | string | **Yes**  | —       | Must be `"listOfTables"`                                                                            |
| `id`         | string | No       | —       | Unique identifier. Max: 100 chars.                                                                  |
| `title`      | string | No       | —       | Title displayed above the list (e.g., `"List of Tables"`, `"Tabellenverzeichnis"`). Max: 200 chars. |
| `tabStyle`   | string | No       | `"dot"` | Leader style between caption and page number: `"dot"`, `"hyphen"`, `"underscore"`, `"none"`         |
| `fontFamily` | string | No       | —       | Font family for the title. Max: 100 chars.                                                          |
| `fontSize`   | number | No       | —       | Font size for the title in pt (6–72).                                                               |
| `spacing`    | object | No       | —       | Spacing override with `before` and `after` in pt (0–100).                                           |

<Info>
  Only tables with a `caption` property appear in the list of tables. The table numbering prefix (e.g., "Table", "Tab.", "Tabelle") is controlled by `defaults.styles.tableCaption.prefix`.
</Info>

## List of Code Listings

Generates an automatic list of all code blocks that have a `caption` property.

```json theme={null}
{
  "type": "listOfCodeListings",
  "title": "List of Code Listings",
  "tabStyle": "dot"
}
```

### Properties

| Property     | Type   | Required | Default | Description                                                                                                 |
| ------------ | ------ | -------- | ------- | ----------------------------------------------------------------------------------------------------------- |
| `type`       | string | **Yes**  | —       | Must be `"listOfCodeListings"`                                                                              |
| `id`         | string | No       | —       | Unique identifier. Max: 100 chars.                                                                          |
| `title`      | string | No       | —       | Title displayed above the list (e.g., `"List of Code Listings"`, `"Quellcodeverzeichnis"`). Max: 200 chars. |
| `tabStyle`   | string | No       | `"dot"` | Leader style between caption and page number: `"dot"`, `"hyphen"`, `"underscore"`, `"none"`                 |
| `fontFamily` | string | No       | —       | Font family for the title. Max: 100 chars.                                                                  |
| `fontSize`   | number | No       | —       | Font size for the title in pt (6–72).                                                                       |
| `spacing`    | object | No       | —       | Spacing override with `before` and `after` in pt (0–100).                                                   |

<Info>
  Only code blocks with a `caption` property appear in the list. The listing numbering prefix (e.g., "Listing", "Code", "Quellcode") is controlled by `defaults.styles.codeCaption.prefix`. Diagram code blocks (e.g., `mermaid`, `plantuml`) with captions appear in the **List of Figures** instead — unless `renderAsImage` is `false`. See [Diagrams](/api-reference/json-syntax/sections/media#diagrams).
</Info>

## Complete example

A typical academic document structure with all index elements:

```json theme={null}
{
  "document": { "type": "pdf", "size": "A4" },
  "abbreviations": { "API": "Application Programming Interface", "REST": "Representational State Transfer" },
  "citations": [
    { "id": "smith2023", "type": "book", "title": "Document Automation", "author": [{ "family": "Smith", "given": "John" }], "issued": { "date-parts": [[2023]] } }
  ],
  "defaults": {
    "citationStyle": "apa7",
    "styles": {
      "figureCaption": { "prefix": "Figure", "fontSize": 9 },
      "tableCaption": { "prefix": "Table", "fontSize": 9 }
    }
  },
  "sections": [
    {
      "type": "page",
      "align": "center",
      "content": [
        { "type": "h1", "text": "Research Paper", "align": "center" }
      ]
    },
    {
      "type": "flow",
      "content": [
        { "type": "toc", "title": "Table of Contents", "maxLevel": 3 },
        { "type": "pageBreak" },
        { "type": "listOfFigures", "title": "List of Figures" },
        { "type": "listOfTables", "title": "List of Tables" },
        { "type": "listOfCodeListings", "title": "List of Code Listings" },
        { "type": "listOfAbbreviations", "title": "Abbreviations" },
        { "type": "pageBreak" }
      ]
    },
    {
      "type": "flow",
      "content": [
        { "type": "h1", "text": "Introduction" },
        { "type": "text", "text": "This paper examines the ~API~ design patterns described by @[smith2023]." },
        { "type": "image", "src": "https://example.com/overview.png", "caption": "System overview", "anchor": "fig-overview" },
        { "type": "h2", "text": "Data" },
        {
          "type": "table",
          "caption": "Experiment results",
          "anchor": "tab-results",
          "headers": ["Test", "Score"],
          "rows": [["A", "95%"], ["B", "87%"]]
        },
        { "type": "text", "text": "As shown in [Figure 1](#fig-overview) and [Table 1](#tab-results), the results are promising." },
        { "type": "h2", "text": "Implementation" },
        {
          "type": "code",
          "language": "typescript",
          "code": "async function analyze(data: Result[]): Promise<Report> {\n  const valid = data.filter(r => r.score > 0);\n  return generateReport(valid);\n}",
          "caption": "Data analysis function",
          "anchor": "code-analyze"
        },
        { "type": "text", "text": "The implementation in [Listing 1](#code-analyze) processes the raw data." },
        { "type": "pageBreak" },
        { "type": "bibliography", "title": "References" }
      ]
    }
  ]
}
```
