Typst is so much more elegant than LaTeX, yet as it can embed programming functions directly can be extended in many ways. There are of course still outstanding weaknesses compared to LaTeX (given decades of packages and development); you can read more on the comparison with LaTeX here: Guide for LaTeX users – Typst Documentation
You can install the command-line version using homebrew: brew install typst — there is an online editor too.
Pandoc now supports Typst input/output, so existing Pandoc projects can be configured to use Typst as the PDF engine. Scrivener could also easily output typst PDFs without needing Pandoc by using Styles, Section Types and the compiler post-processor directly.
Read about this in the release notes for the latest release of pandoc however Typst is still very much in development (0.4 at this moment in time) and much missing for seasoned LaTeX users. Maybe in time it will rival LaTeX but right now it has serious limitations. Worth reading John MacFarlane’s comments on his announcement that pandoc 3.1.3 now has preliminary support for Typst.
Typst is definitely a young project, with the chance that some of the core syntax may change. You can have a look at their Roadmap to see where they are heading (lots of really neat stuff). For most mortal humans LaTeX (powerful as it is) is a series of unintelligible incantantions that can work wonders, but requires a high cognitive load, inelegant markup (solved by using Pandoc or MMD of course) and tons of google searching to make “simple” changes. I honestly do not use most of the possible packages LaTeX offers, and sometimes just drop doing something in LaTeX as I can do it more simply in LibreOffice.
Yes, the final submission puzzle for academics is still undefined from the Typst website at least, perhaps you can ask on their discord server? I assumed Pandoc would serve as that bridge, and thought i saw some interaction between Typst developers and John (Pandoc creator) but forget where I saw that. Typst is still in quite a state of flux, and as beautifully elegant as it is, I’ll stick to markdown for the time being for most projects
You can just use Typst directly, without having to transcode to/from Markdown (Pandoc/Quarto etc.) — there is certainly enough in its layout engine to make book projects, though things will get much better as their roadmap gets filled out: Roadmap – Typst Documentation
Not at all, I mean to use Scrivener’s compiler to output Typst and use the typst command as the post-processor, much like the direct-LaTeX template does. With careful structuring, you can use styles and section types to drive either markdown or typst outputs. Scrivener always stays in the driver’s seat, it is the compiler that is tasked with the work of translation…
My original note about Typst not being compatibile with Quarto’s book format is particularly obtuse. This shows how confused I am with this matter.
Obviously, there is no reason to go through the book format, when all that Typst is called to do is a monolithic PDF file. So, the workflow is Scrivener → Pandoc → Quarto → Typst with a single .md file.
Well, I’ve been able to compile my first PDF with Quarto and Typst. Only, it is just EVERYTHING I typed in Scrivener, including the markup codes.
I added a configuration block at the beginning of the .md file to be processed, but maybe I lack some more information about what to add there. For example, the template is probably just a placeholder.
For example, when running a quarto typst compile [filename] command, I get several errors of this type:
error: expected expression
┌─ Documents/[filename and path]:13:1
13 │ # This is a title
I don’t see anything wrong, according to the Pandoc markdown syntax. So, I wouldn’t know what to fix.
I also get several errors from asterisks (*) used by the compiler for bullet lists. And hashtags (#) inserted in the text (representing note names with a sharp symbol, for example in ‘C#’) are reported as errors by Quarto/Typst. And text between strong/bold markup (**[text]**) is reported as “no text”, and “unnecessary multiple consecutive stars”.
Headings, inline styles, figures, footnotes etc. are working; more advanced features will need more tweaking and some method to inject typst markup directly to change the layout etc. is still required.
The one I tried was the simplest one (a title, a body text). But now I understand what could have been wrong: I presumed that the source markdown file had to be in Pandoc markdown syntax. Apparently, it has to be in the Typst syntax.
In fact, when I replaced the hashtag (#) with an equali sign (=) in the source file, the document sections were understood, and the PDF file generated. Only, it also contained the configuration block. I’m using the most up-to-date versions of Quarto, Typst and Pandoc, as from their official installers (even if beta).
So, I guess compiling from Scrivener should require something similar to the LaTeX Modern template. It is not just a matter of letting Quarto convert a Pandoc MMD file generated by Scrivener. I understand it will be quite a work, even if probably much easier than with LaTeX.
At this point, I’m not sure what the Pandoc Typst writer is doing.
EDIT: Or, maybe I should tell the compile format, in Scrivener, that it should use Typst for conversion? Writing it in the document’s configuration head is not enough, even for Quarto?
No, your new presumption is wrong, the old one was fine!
The ideal workflow:
The text in Scrivener should use Scrivener’s styles and Section Types, so emphasis for italic etc. and use appropriate Section Types.
Then you compile to Pandoc markdown.
Scrivener compiler makes a Pandoc MD file.
The pandoc command is: pandoc -f markdown -t typst -o out.pdf in.md – this command can be done in the post-processing pane of the compiler or you can run it yourself in Terminal…
You will get a PDF next to the MD file. See above for the sample I made direct from Scrivener.
I attached a working Scrivener project that demonstrates how to do this above. I have an Apple Silicon Mac so my homebrew is /opt/homebrew/bin so if you have an Intel you’ll need to change the post-processing commands. But that project demonstrates what you need.
We can build from that, as we can use Styles or Section Types to inject the formatting markup for e.g. one/two columns, fonts etc. So that just as for Quarto compile formats, we can do detailed layout using Scrivener’s editing features… The limits for this workflow will be reached when we bump up to Typst limitations or the fact Pandoc may not fully support all typst features…
Just to clarify: Quarto may not support Typst properly yet, so using Quarto instead of Pandoc adds lots of additional complexity, just stick to pandoc for the moment. Again open my project and see exactly what is done there…