Skip to content

Forward/reverse jump between source and preview breaks down for multi-file projects #908

Description

@ertugruluyar-github

Description

When a project uses a single main file with everything written inline, clicking in the source and having the preview scroll to the matching location (and vice versa) works reasonably well. However, once a project is split across multiple .typ files — a common pattern for larger documents such as theses, reports, or books, where content is organized into separate section/chapter files and pulled together from a main file via imports/includes/function calls — this forward/reverse sync between source and preview becomes unreliable or stops working correctly when editing a file other than the main one.

This is a real friction point for any document following a modular multi-file structure (e.g. main.typ calling into sections/01-intro.typ, sections/02-methodology.typ, etc.), which is standard practice for long-form academic writing.

I'd like to request:

  • Forward sync: placing the cursor in any source file that's part of the project (not just the currently active/main file) should scroll/highlight the matching location in the rendered preview.
  • Reverse sync: clicking a location in the rendered preview should open (or focus) the correct source file among the project's files and jump the cursor to the matching line, even if that content lives in a subfile rather than the main file.

For comparison, the Tinymist Typst VS Code extension already supports accurate forward/reverse jump-to-source across split files, so the underlying compiler capability (source position / click-to-jump mapping) appears to already exist — this request is specifically about bringing that same reliability to the multi-file case in the web app's editor/preview pane.

Use Case

I'm writing a PhD thesis using a Typst template that splits content across many files (introduction, literature review, methodology, findings, discussion, appendices, etc.), all pulled into a single main.typ. When editing any of these subfiles, I lose the ability to reliably jump to the matching preview location, or to click a spot in the rendered PDF-like preview and land back on the correct line in the correct subfile. This makes proofreading and navigating a long, modular document much slower than it would be with reliable two-way sync, and it's a workflow I already rely on daily when using SyncTeX-equivalent features in other editors (e.g. Tinymist in VS Code).

hcyWoPLLy9.2.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions