Why I rebuilt Typst preview for Typsastra

Hi everyone,

I wrote an article about how Typsastra evolved from a complex-script-focused editor into an environment capable of previewing very long Typst documents.

The article covers:

  • why I moved from a full-document SVG preview to a virtualized PDF preview;
  • the memory problems I observed while testing documents with hundreds of pages;
  • bounded canvas rendering and motion-aware scheduling;
  • preserving forward and inverse synchronization in large, multi-file projects;
  • testing source files with around 20,000 lines and PDFs reaching approximately 1,500 pages;
  • why I consider performance and support for modest hardware part of accessibility.

This is not intended as a universal benchmark or criticism of Tinymist’s preview. SVG preview provides excellent responsiveness and partial updates. Typsastra simply makes a different trade-off: accepting a small refresh delay in exchange for predictable memory use on very large documents.

You can read the full article here:

I would be interested to hear how others work with long Typst documents, what preview limitations they encounter, and whether anyone has reproducible stress-test projects that could help improve Typsastra further.

7 Likes

I tend to be old school with large documents. I break them up into a main file and individual chapter files and edit these individually, usually on the command line with the stock vi editor.

In a separate terminal I have typst watch the main file. Any syntax errors show up in that terminal widow.

I keep the PDF open in Document Viewer.

My machine is beefy with lots of RAM so memory pressure is not an issue.

But being old school is just my fallback. I do follow developments in proper GUI Typst editors as they have the benefit of smart auto-completion, typically via Tinymist. This saves a lot of time because when editing with vi , and I see an error message in the watch window, I then have to search the Typst Documentation web site in Firefox to figure out why some syntax is wrong.

1 Like

Hi @Johannes_Rexx, that is actually very close to the workflow Typsastra is built for. Editing one chapter at a time is usually faster, so Typsastra supports both the full preview from the main file and a standalone preview for the chapter you are currently working on.

Most of the time, you can stay in the standalone chapter preview for quicker updates. But every so often, you still need to compile the whole document to check the overall flow, page numbering, bibliography, or cross-references between chapters in different files.

The goal is to let authors preview the complete document while keeping Tinymist features like diagnostics, completion, and forward and inverse sync, even on a moderate computer.

That’s a nice write-up and I think stating clearly the goals and non-goals of Typsastra has a lot of value.

1 Like