Skip to content

Cannot cross reference solution and remark environments in Typst #14290

@andrewheiss

Description

@andrewheiss

I have:

  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide

Bug description

In Typst, all the theorem variations listed in the documentation work without problem except for remark and solution.

Steps to reproduce

Here's a reprex:

---
title: "Theorem cross referencing"
format: typst
---

::: {#rem-thing}

## Example

This is some content

:::

See @rem-thing

(switch rem-thing to sol-thing to trigger the same error)

Actual behavior

This emits this typst:

#block[
#emph[Remark 1] (Example). This is some content

] <rem-thing>
See #ref(<rem-thing>, supplement: [Remark])

…and it causes an error:

ERROR: error: cannot reference block
    ┌─ test.typ:374:5
    │
374 │ See #ref(<rem-thing>, supplement: [Remark])
    │      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


ERROR: Typst compilation failed

Expected behavior

Ideally, solutions and remarks should work (or the documentation should note that there are potential problems with them). From this comment, it sounds like solutions and remarks are using some sort of special workaround already, so maybe that's related?

Your environment

  • Positron 2026.03.0 build 212 (but this happens in RStudio, terminal, etc. too)
  • macOS Tahoe 26.3.1

Quarto check output

❯ quarto check
Quarto 1.9.36
[✓] Checking environment information...
      Quarto cache location: /Users/andrew/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.8.3: OK
      Dart Sass version 1.87.0: OK
      Deno version 2.4.5: OK
      Typst version 0.14.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.9.36
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (external install)
      VeraPDF: 1.28.2
      Chromium: (not installed)
      Chrome Headless Shell: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/andrew/Library/TinyTeX/bin/universal-darwin
      Version: 2025

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
      Source: MacOS known location

[✓] Checking basic markdown render....OK

[✓] Checking R installation...........OK
      Version: 4.5.2
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/andrew/Library/R/arm64/4.5/library
        - /Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library
      knitr: 1.50
      rmarkdown: 2.30

[✓] Checking Knitr engine render......OK

[✓] Checking Python 3 installation....OK
      Version: 3.13.1
      Path: /Users/andrew/.virtualenvs/quarto/bin/python3
      Jupyter: 5.7.2
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking Julia installation...

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions