Skip to content

set typst version in document #6567

Closed

Description

@goyalyashpal

Description

  • allow to specify typst version in document, and check that version while compiling on cli

if the versions don't match, then give option to:

  • fail-fast, i.e. exit right away with helpful message
  • proceed normally

if the version is not specified, warn users of missing version and recommend to specify the current typst --version value.

inspiration:

CMakeLists.txt in cmake mentions the required version at top of the file.

random example from github:
https://github.com/jaskang/wukong-minimap/blob/7375f465af7c7c3712c6ececa3a0ed623173533d/b1sdk/CMakeLists.txt#L4

Use Case

as many documents, even packages, become old / not regularly updated,
it can become a hassle to figure out which typst version the document was originally compiled with.

even if one has time to update the whole big document / package right away, still being able to know the version may help to decipher the original intent.

Activity

  1. added
    feature request
    on Jul 7, 2025
  2. MDLC01 commented on Jul 7, 2025

    @MDLC01
    Collaborator

    You can already get the current compiler version from within a Typst script with sys.version (https://typst.app/docs/reference/foundations/version/). Then, it is up to you to implement the panic with error message.

    For further question, I recommend you go to the Typst Forum or join the Discord server, where people will be able to answer them.

  3. goyalyashpal commented on Jul 7, 2025

    @goyalyashpal
    Author

    hi @MDLC01 ! thanks for quick response.

    then i would like to suggest a documentation change for example in tutorial.

    so can you plese label it with documentation and reopen?

  4. MDLC01 commented on Jul 7, 2025

    @MDLC01
    Collaborator

    Sure! Can you clarify what specific part of the documentation you think should be modified? I'm personally not sure the tutorial would be the best place as it is primarily intended for beginners.

  5. reopened this on Jul 7, 2025
  6. added
    docs
    and removed
    feature request
    on Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions