Skip to main content
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.
The listOfAbbreviations and bibliography elements are documented on their own pages: Abbreviations and Citations.

Table of Contents

Generates an automatic table of contents from headings in the document.
{
  "type": "toc",
  "title": "Table of Contents",
  "maxLevel": 3,
  "hyperlink": true
}

Properties

PropertyTypeRequiredDefaultDescription
typestringYesMust be "toc"
idstringNoUnique identifier. Max: 100 chars.
titlestringNoTitle displayed above the TOC (e.g., "Table of Contents", "Inhaltsverzeichnis"). Max: 200 chars.
maxLevelnumberNo3Maximum heading level to include (1–6). E.g., 3 includes h1, h2, h3.
hyperlinkbooleanNotrueMake TOC entries clickable links to the corresponding headings.
fontFamilystringNoFont family for the title. Max: 100 chars.
fontSizenumberNoFont size for the title in pt (6–72).
spacingobjectNoSpacing override with before and after in pt (0–100).

Example usage

{
  "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.
{
  "type": "listOfFigures",
  "title": "List of Figures",
  "tabStyle": "dot"
}

Properties

PropertyTypeRequiredDefaultDescription
typestringYesMust be "listOfFigures"
idstringNoUnique identifier. Max: 100 chars.
titlestringNoTitle displayed above the list (e.g., "List of Figures", "Abbildungsverzeichnis"). Max: 200 chars.
tabStylestringNo"dot"Leader style between caption and page number: "dot", "hyphen", "underscore", "none"
fontFamilystringNoFont family for the title. Max: 100 chars.
fontSizenumberNoFont size for the title in pt (6–72).
spacingobjectNoSpacing override with before and after in pt (0–100).
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.

Example usage

{
  "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.
{
  "type": "listOfTables",
  "title": "List of Tables",
  "tabStyle": "dot"
}

Properties

PropertyTypeRequiredDefaultDescription
typestringYesMust be "listOfTables"
idstringNoUnique identifier. Max: 100 chars.
titlestringNoTitle displayed above the list (e.g., "List of Tables", "Tabellenverzeichnis"). Max: 200 chars.
tabStylestringNo"dot"Leader style between caption and page number: "dot", "hyphen", "underscore", "none"
fontFamilystringNoFont family for the title. Max: 100 chars.
fontSizenumberNoFont size for the title in pt (6–72).
spacingobjectNoSpacing override with before and after in pt (0–100).
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.

List of Code Listings

Generates an automatic list of all code blocks that have a caption property.
{
  "type": "listOfCodeListings",
  "title": "List of Code Listings",
  "tabStyle": "dot"
}

Properties

PropertyTypeRequiredDefaultDescription
typestringYesMust be "listOfCodeListings"
idstringNoUnique identifier. Max: 100 chars.
titlestringNoTitle displayed above the list (e.g., "List of Code Listings", "Quellcodeverzeichnis"). Max: 200 chars.
tabStylestringNo"dot"Leader style between caption and page number: "dot", "hyphen", "underscore", "none"
fontFamilystringNoFont family for the title. Max: 100 chars.
fontSizenumberNoFont size for the title in pt (6–72).
spacingobjectNoSpacing override with before and after in pt (0–100).
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.

Complete example

A typical academic document structure with all index elements:
{
  "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" }
      ]
    }
  ]
}