I’m using neovim (AstroNvim) for Typst, Typst Language Pack. It works, my preview looks like I expect. When I try to generate a PDF from the same typ file, I get an error:
master ~/spaces/text/wei> typst compile the-hundred-squares-ru.typ hunnerd.pdf
error: entry does not have field "page"
┌─ robinson-toc.typ:67:48
│
67 │ #subcnt #box(width: 1fr, repeat[.]) #it.page
│ ^^^^
exit 1
master ~/spaces/text/wei>
I understand that my info is insufficient; what data should I supply? Nevertheless, it looks like the CLI typst lacks some environment that the Preview has. What could that be?
I assume the offending code is part of a show rule for an outline entry.
As the field it.page has been replaced with a function it.page() starting with Typst v0.13, it seems to me that you have the 0.13 release candidate installed. This version of Typst is then used when you run typst compile, whereas typst-preview likely ships its own compiler, which still uses version 0.12.
Tinymist uses even patch releases (e.g. 0.12.18) for regular releases – this would be equivalent to Typst 0.12 – and odd releases (e.g. 0.12.21) for pre-releases – this specific one uses 0.13 (or a Typst commit very close to it) but isn’t considered stable enough for Tinymist 0.13.0 yet.
So while Tinymist (necessarily) uses a fork of the Typst compiler to support its features, using a stable (even) release ensures you’re using the released version of Typst.
Right now Typst 0.13.0 is released, Tinymist and Typs Preview updated (?), to what versions I’m not sure, and not working any more. That is, I have gray space instead of preview while typst compile works (with breaking changes corrected).
Tinymist 0.12.20, which may be critical, if I understand you correctly. So far it refuses to update, and for good reason, apparently. The latest release is still 0.12.20: Tinymist
On even patches, tinymist 0.x is equivalent to Typst 0.x. So if your goal is working with 0.13 and tinymist is still on 0.12,you definitely want an odd patch version.
There was also 0.12.19, you can try to “downgrade” to that if 0.12.21 is not ready yet for your editor.