#5382·typst

Allow loading of files outside the project folder (in addition to --root)

Author: woerndlCreated Nov 5, 2024Updated Sep 12, 2026
Labelsfeature requestcli

Description

Assume you have a file structure that shares a template or other common parts:

project/
  - common/
  - thesis-1/
  - thesis-2/

You can run typst compile thesis-1/main.typ --root ~/project/ or symlink parts (= PITA). But you can't import common files in a way that gets rid of the error message (in this case Tinymist). Because the live syntax check (be it Tinymist or any other future solution) can't know what the scope of the project is, as it is not a permanent setting.

Searching in Discord I found a couple of people with the same issue, be it for books, a thesis (split chapters) etc.

Use Case

Having --root as the only option to include files outside the current directory is, to quote another user, a "too basic of a thing not to have". I would agree with that assessment and propose considering a way for permanent relative imports outside the project root.