jgm/typst-hs

Error when importing from ctheorems:1.1.2

Opened this issue · 2 comments

A Typst document test.typ containing only the import statement #import "@preview/ctheorems:1.1.2": * will fail with pandoc 3.1.12.2, giving the message:

"test.typ" (line 1, column 2):
"/home/kaarel/.cache/typst/packages/preview/ctheorems/1.1.2/lib.typ" (line 223, column 18):
unexpected '>'
expecting operator

test.typ compiles with Typst version 0.10.0.

jgm commented

Here's the place where it fails:

  show figure.where(kind: "thmenv"): it => it.body

  show ref: it => {
    if it.element == none {
      return it

It fails on the second show.
I'm not sure yet why.

jgm commented

The changes in #43 seem to have fixed this to the point where the package's code can be parsed. I now get a different error:

...Library/Caches/typst/packages/preview/ctheorems/1.1.2/lib.typ" (line 165, column 2):
Content does not have a method "update" or FieldAccess requires a dictionary

This is on:

// Show the qed symbol, update state
#let thm-qed-show = {
  thm-qed-done.update("thm-qed-symbol")
  thm-qed-done.display()
}

We don't yet support https://typst.app/docs/reference/introspection/state/