typst / typst/typst

Bookmarks are displaying at the correct depth only in the Typst app but not in other PDF readers.

Open
#5,615 11 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug pdf
Dominant language
Rust
Stars
56.1k
Forks
1.7k
Avg merge
3d 10h
Merged PRs (30d)
22

Description

Description

REPREX:

#outline(
  title: auto,
  indent: 2em,
)
    
#heading("Heading A.1", level: 1, outlined: true, bookmarked: true)
#heading("Heading B.1", level: 2, outlined: true, bookmarked: true)
#heading("Heading C.1", level: 3, outlined: true, bookmarked: true)
#heading("Heading C.2", level: 3, outlined: true, bookmarked: true)
#heading("Heading C.3", level: 3, outlined: true, bookmarked: true)

#heading("Heading A.1", level: 1, outlined: false, bookmarked: false)
#heading("Heading B.2", level: 2, outlined: true, bookmarked: true)
#heading("Heading C.1", level: 3, outlined: true, bookmarked: true)
#heading("Heading C.2", level: 3, outlined: true, bookmarked: true)
image image

Heading B.2 should be inside Heading A.1

Here's the output file.

Test.pdf

Reproduction URL

No response

Operating system

No response

Typst version
  • I am using the latest version of Typst

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided Typst reproduction and inspect Test.pdf in multiple PDF readers to compare bookmark nesting. Trace the PDF outline generation from this example, then verify that Heading B.2 is nested under Heading A.1 while the other heading levels retain their expected depth.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.