Skip to content

Typst cross-references should escape following punctuation #13388

@CoryMcCartan

Description

@CoryMcCartan

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

Some punctuation after a cross-reference is not displayed in the rendered document because it is not escaped in the Typst output.

Steps to reproduce

---
format:
    typst:
        number-sections: true
---

# Section one {#sec-one}

This is @sec-one, the next section is @sec-two. (Works)

# Section two {#sec-two}

This is @sec-one; the next section is @sec-two. (Does not work)

Actual behavior

Image

Additionally, if you write @sec-one(a) (this happens more when referencing subpanels which are integrated into a figure and so can't be directly cross-referenced), then Typst errors with unknown variable: a because the Typst output is #ref(<sec-one>, supplement: [Section])(a) which looks like a function call.

Expected behavior

The semicolon should render in Section Two, and parentheses immediately following a cross-reference should work and not produce a rendering error.

The solution appears to be escaping any punctuation immediately following a cross reference; see https://forum.typst.app/t/why-does-a-semicolon-go-missing-from-output-when-inserted-directly-after-code-expression/1347

Your environment

No response

Quarto check output

Quarto 1.7.29
[✓] Checking environment information...
      Quarto cache location: /Users/cmccartan/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.85.1: OK
      Deno version 1.46.3: OK
      NOTE: Typst version 0.13.1 does not strictly match 0.13.0 and strict checking is enabled. Please use 0.13.0.
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.7.29
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/cmccartan/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 Python 3 installation....OK
      Version: 3.9.6
      Path: /Library/Developer/CommandLineTools/usr/bin/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

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

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions