Writing

Link to a heading or another chapter

Pinery supports fragment links inside a book—not Obsidian-style [[wiki links]]. For a full syntax list, see the Markdown cheat sheet.

Insert an automatic table of contents

Create a chapter wherever you want the table of contents to appear:

# Table of Contents

{{TOC}}

Pinery expands {{TOC}} in Design and when you export. The generated table follows your manuscript order, can include headings inside chapters when enabled, and shows page numbers from the paginated layout.

Design preview of a Contents chapter with generated table of contents
Design — generated TOC with chapter titles and page numbers.

Table of contents settings

Open Metadata → Table of Contents to control what appears in the generated list:

  • List headers within chapters — When off (the default), the TOC lists chapter titles only. Turn it on to include headings from each chapter.
  • Heading levels — When listing headers within chapters, choose which levels (H1–H6) to include.

When a chapter title matches its first H1, that heading is omitted from the TOC to avoid duplication.

Front matter

By convention, the TOC lists chapters that come after the chapter that contains {{TOC}}—so a Contents chapter after a foreword won’t list Cover or Foreword. Earlier spine items and the contents chapter itself are not listed.

  1. Add an explicit id on the heading line:
## The Harbor {#harbor}
  1. Link to it:
Return to [the harbor](#harbor).

Use the same #id when the target heading defines {#id} in that chapter.

For HTML and ePub export, you can also link to another chapter by filename stem (the chapter name without extension):

[Read chapter two](#chapter-two-filename)

These links work in exported HTML, ePub, and PDF.

Standard Markdown works:

Visit [Pinery](https://pinery.app).

Next steps