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

# Automatic Indices

> Generate a table of contents, list of figures, list of tables, list of code listings, and list of abbreviations automatically from your document content.

Autype can automatically generate indices from your document content. All indices use inline directive syntax (`::directive{attrs}`).

## Table of Contents

Generate a TOC from all headings in the document:

```markdown theme={null}
::toc
```

### With options

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

### Attributes

| Attribute   | Values          | Default  | Description                      |
| ----------- | --------------- | -------- | -------------------------------- |
| `title`     | String          | *(none)* | Title displayed above the TOC    |
| `maxLevel`  | 1–6             | 3        | Maximum heading level to include |
| `hyperlink` | `true`, `false` | `true`   | Make entries clickable           |

<Note>
  The TOC is generated as a document field. When opening in Word or LibreOffice, you may be prompted to update fields to populate the TOC with page numbers.
</Note>

### Example

```markdown theme={null}
# My Document

::toc{title="Contents" maxLevel=2}

---

## Chapter 1

Content...

## Chapter 2

Content...
```

***

## List of Figures

Generate a list of all figures (images and charts with captions):

```markdown theme={null}
::listOfFigures
```

**Short alias:**

```markdown theme={null}
::lof
```

### With options

```markdown theme={null}
::listOfFigures{title="List of Figures"}
::lof{title="Abbildungsverzeichnis" tabStyle=hyphen}
```

### Attributes

| Attribute  | Values                                | Default  | Description                                      |
| ---------- | ------------------------------------- | -------- | ------------------------------------------------ |
| `title`    | String                                | *(none)* | Title displayed above the list                   |
| `tabStyle` | `dot`, `hyphen`, `underscore`, `none` | `dot`    | Tab leader style between caption and page number |

### How figures are numbered

Figures are automatically numbered based on:

* **Images** with alt text (alt text becomes the caption): `![Sales Dashboard](img.png)`
* **Images** with explicit `caption` attribute: `![](img.png){caption="Sales Dashboard"}`
* **Charts** with a `caption` attribute: `:::chart{caption="Revenue 2024"}`

The figure prefix (e.g., `"Figure"`, `"Abb."`) and caption styling are configured in your document's [style settings](/getting-started/editor/sidebar-styles#figure-captions).

***

## List of Tables

Generate a list of all tables with captions:

```markdown theme={null}
::listOfTables
```

**Short alias:**

```markdown theme={null}
::lot
```

### With options

```markdown theme={null}
::listOfTables{title="List of Tables"}
::lot{title="Tabellenverzeichnis" tabStyle=hyphen}
```

### Attributes

| Attribute  | Values                                | Default  | Description                                      |
| ---------- | ------------------------------------- | -------- | ------------------------------------------------ |
| `title`    | String                                | *(none)* | Title displayed above the list                   |
| `tabStyle` | `dot`, `hyphen`, `underscore`, `none` | `dot`    | Tab leader style between caption and page number |

### How tables are numbered

Tables are automatically numbered based on tables that have the `caption` attribute in the `:::table` directive:

```markdown theme={null}
:::table{caption="Revenue by Quarter"}
| Quarter | Revenue |
|---------|---------|
| Q1 | €150,000 |
:::
```

The table prefix (e.g., `"Table"`, `"Tabelle"`) and caption styling are configured in your document's [style settings](/getting-started/editor/sidebar-styles#table-captions).

***

## List of Code Listings

Generate a list of all code blocks with captions:

```markdown theme={null}
::listOfCodeListings
```

**Short alias:**

```markdown theme={null}
::loc
```

### With options

```markdown theme={null}
::listOfCodeListings{title="List of Code Listings"}
::loc{title="Quellcodeverzeichnis" tabStyle=hyphen}
```

### Attributes

| Attribute  | Values                                | Default  | Description                                      |
| ---------- | ------------------------------------- | -------- | ------------------------------------------------ |
| `title`    | String                                | *(none)* | Title displayed above the list                   |
| `tabStyle` | `dot`, `hyphen`, `underscore`, `none` | `dot`    | Tab leader style between caption and page number |

### How code listings are numbered

Code listings are automatically numbered based on code blocks that have the `caption` attribute:

````markdown theme={null}
```typescript{caption="Configuration interface" anchor="code-config"}
interface Config {
  apiUrl: string;
  timeout: number;
}
```
````

The listing prefix (e.g., `"Listing"`, `"Quellcode"`) and caption styling are configured in your document's [style settings](/getting-started/editor/sidebar-styles#code-captions).

<Info>
  Diagram code blocks (e.g., `mermaid`, `plantuml`) with captions are numbered as **figures** and appear in the List of Figures, not the List of Code Listings — unless `renderAsImage=false` is set. See [Diagrams](/markup-reference/diagrams) for details.
</Info>

***

## List of Abbreviations

Generate a list of all abbreviations used in the document:

```markdown theme={null}
::listOfAbbreviations
```

**Short alias:**

```markdown theme={null}
::loa
```

### With options

```markdown theme={null}
::listOfAbbreviations{title="List of Abbreviations" sortOrder=alphabetical}
::loa{title="Abkürzungsverzeichnis" sortOrder=document}
```

### Attributes

| Attribute   | Values                     | Default        | Description                    |
| ----------- | -------------------------- | -------------- | ------------------------------ |
| `title`     | String                     | *(none)*       | Title displayed above the list |
| `sortOrder` | `alphabetical`, `document` | `alphabetical` | Sort order                     |

* **`alphabetical`** — abbreviations sorted A–Z
* **`document`** — abbreviations in the order they first appear

<Tip>
  See [Abbreviations](/markup-reference/abbreviations) for how to mark abbreviations in your text with `~ABK~` syntax.
</Tip>

***

## Tab leader styles

The `tabStyle` attribute controls the visual separator between the entry text and the page number:

| Style        | Appearance                   |
| ------------ | ---------------------------- |
| `dot`        | `Chapter 1 .............. 3` |
| `hyphen`     | `Chapter 1 ------------ 3`   |
| `underscore` | `Chapter 1 ____________ 3`   |
| `none`       | `Chapter 1              3`   |

***

## Full example: Academic document

````markdown theme={null}
---page{align=center}---

# Research Paper Title

**Author Name**

{{date/D. MMMM YYYY}}

---/page---

---

::toc{title="Table of Contents" maxLevel=3}

---

::lof{title="List of Figures"}

---

::lot{title="List of Tables"}

---

::loc{title="List of Code Listings"}

---

::loa{title="List of Abbreviations" sortOrder=alphabetical}

---

## Introduction {#intro}

The ~WHO~ has published guidelines on this topic @[who2023].

## Results

:::chart{type="bar" caption="Survey Results" anchor="chart-results"}
labels: Group A, Group B, Group C
dataset: Score | 85, 72, 91 | #3b82f6
:::

:::table{caption="Detailed Scores"}
| Group | Mean | SD |
|-------|------|----|
| A | 85.2 | 4.1 |
| B | 72.1 | 6.3 |
| C | 91.0 | 2.8 |
:::

As shown in [Figure {num}](#chart-results), Group C performed best.

## Implementation

```typescript{caption="Data Processing Function" anchor="code-process"}
async function processResults(data: RawData[]): Promise<Report> {
  const validated = data.filter(d => d.isValid);
  return generateReport(validated);
}
```

See [Listing {num}](#code-process) for the data processing implementation.

## References

::bibliography{title="References"}
````
