Our previous pipeline was LaTeX-based (first pdflatex, then lualatex), but we were constantly fighting cryptic memory errors on large documents and huge Docker image sizes that slowed down boot times of our ephemeral workers.
Switching to Typst was a massive win for us. The single static binary resulted in tiny images and faster boot times. More importantly, the performance gains were huge. Overall compile times were ~3–4× faster than LaTeX. On really large documents (2000+ pages, mostly tables), Typst compiles in ~1 minute vs. ~18 minutes with lualatex.
Beyond performance, the better developer experience and good error messages was a nice bonus too.
We wrote a detailed post about the entire architecture - from the job orchestration with Nomad to the S3 optimizations and the Typst migration in particular. If you're curious, you can read it here: https://zerodha.tech/blog/1-5-million-pdfs-in-25-minutes
Here are my most important requirements: Multiple columns configurable for meaningful column and page breaks (minimum number of lines in a new column or page). Reliable automatic hyphenation for multiple languages (at least English and German, perhaps French, Italian and Spanish in the future). Pictures in columns with dynamic placing according to the available space. Complex tables and forms with sensible automatic page breaks. Background images. Different areas on the page which are treated like mini-pages. -- Is Typst capable of all that?
It’s always been some combination of MJML, inline DIY HTML, or PDFs generated with Puppeteer etc.
Do you think Typst would be a good fit there too?
I'm a PhD student currently writing my thesis in Typst. On paper this is an absurdly risky decision: it's a new technology without a huge user-base, it's not totally stable yet, etc. But I tried Typst and I had no choice. It was obviously the right thing to do, even though I'm going to have to make a pixel-perfect clone of my university's LaTeX template.
I've been using LaTeX for over ten years and I still wouldn't say that I "know" TeX in any meaningful way. I was not only productive but proficient in Typst in a day or two. If there isn't a package for something that I need (and, surprisingly often, there are packages for what I need, and excellent ones!), I find that I can just do it myself. Quickly. Things that never would have been possible for me with LaTeX are within easy reach. In ways I'd be happy to talk about if anyone's curious, it's been a huge enabler of my productivity as a researcher. I owe this tool so much.
Interestingly, I spend far, far less time yak-shaving in Typst than in TeX, since I can just Do The Thing That I Want. I'm actually focusing on writing instead of figuring out why package A conflicts with package B, and then how to install a different version of just a single package to override one of them, and then... [this sort of thing doesn't/can't happen in Typst; it's a real programming language with real modules] I could go on and on about the (relative) quality of the ergonomics and devex: fast compilation times, as others have said, but so much more than that. Try it out. Just try it out.
I should also say that it's not perfect. There are some funky design decisions for sure. There are some missing features, like including pdfs as images in your document (that one's on its way, I believe). Critically, the quality of the typesetting is maybe... 95% as good as TeX, which is perfect every time. Sometimes things don't kern quite right, and you have to adjust them by hand. It's a work in progress. I'm optimistic that it will achieve parity on that front.
That's lucky. Most of us had to do a LaTeX pixel perfect clone of our university's MS Word template.
I’d say 99% of the experience was super smooth. It was a great decision, though risky as you mentioned—I started with Typst 0.11 and finished with 0.12. The only painful part (that last 1%) happened at the very end when I realized my university only accepted PDF/A (the archival version—I didn’t even know there were different PDF versions before this). While Typst 0.12 theoretically supports generating PDF/A-2b files, the output failed the university’s compliance test. I ended up (after MANY experimentations) using Adobe Acrobat Pro to convert the file, which caused some minor layout adjustments unfortunately.
Apart from that, I highly recommend Typst. It’s an excellent tool, and I hope academic journals will soon accept submissions in this format.
There seems to be a huge amount of folks that want typst to work. I respect TeX and LaTeX, immensely, but it's so vast and byzantine. Maybe I don't know where or what, but some kind of clean LaTeX "distribution" is needed. It seems like you could build it in to containers or something. Just have some way that sort of makes it more of an atomic unit or something. I don't know how many times I've pulled down a template started to build it and something was missing.
It's good to see innovation in this space and people using it.
I'm not sure if you really mean pixel perfect or if it's just an exaggeration. There are packages in latex which are almost impossible to replicate in a pixel perfect way, one widely used example is microtype, which is especially useful in scientific works.
That's an interesting insight. Do you have an idea why this is? Do you have a CS background?
1. It doesn't generate 5 bloody files when compiling.
2. Compiling is instant.
3. Diagnostics are way easier to understand (sort of like Rust compiler suggestion style).
4. List items can be either - item1 - item2, etc. or [item1], [item2]. The latter is way better because you can use anchoring to match on the braces (like "%" in vim), which means navigating long item entries is much easier.
5. In latex you have the \document{...} where you can't specify macros so they need to be at the top, in Typst you can specify the macros close to where you need them.
6. It's easier to version control and diff, especially if you use semantic line breaks.
7. Changing page layout, margins, spacing between things, etc., footers with page counters, etc. just seems way easier to do.
It has the opposite problem where you may have more control than you'd like. But it is in some sense very simple. e.g. this is a valid plain TeX document:
$$\aleph_0$$
\bye
Things don't have to begin{ and end{ etc.
There are simple collections of useful macros like [extended plain] kind of like lodash where the aim is to enhance the classic syntax by ` input eplain` at the top, not take over.
NB: I was so proud to write my thesis entirely in [extended plain], but when it was time to submit it to the library they basically said, "That's nice, nerd, but we have specific style files." and I had to rewrite it into LaTeX anyway!
[extended plain]: https://tug.org/eplain/
I see almost no support in the scientific community for Typst since everyone already has a LaTeX template for a thesis, paper, slides, etc. Researchers need to take the initiative and create a template that is accepted by first a chair, then propagate it in the university and try and get it popular enough so that it hopefully forces the creation of templates for conferences and journals.
This is an incredibly long, tedious, (and I am guessing ongoing) process, but one that is crucial for Typst to be a real contender with LaTeX
It would be nice if Typst could be a LaTeX replacement that makes actually layout and designing the document approachable. I have only used it once for a quick one-off experiment and I did like the language, but as I have said above the language is not the problem if you just want to write text.
[1] That's not quite true, actually. I first wrote my thesis in reStructuredText and used Pandoc to generate the LaTeX and subsequent PDF. This allowed me to get started without having to write a lengthy preamble first. Then after I had more than half of it written down and had a good idea of what I wanted the document to look like did I clean up the generated LaTeX, adjust the formatting to my needs, redid the drawing in TikZ, and then kept writing LaTeX from there. I still think the language is not the problem, but it's easy to get hung up in the design phase before even the first chapter is written.
Pros:
- Instant compile. It just sits there waiting, and once you save your .typ, boom, your .pdf is ready.
- Surprisingly often I find myself using it as markdown replacement, e.g., for random meeting notes. Syntax is as easy as markdown and without boilerplate it produces a nice pdf.
What's not to like?
- IMO debugging can be tricky with quite concise error messages. And it does not produce any pdf once there is a single syntax error, precluding one favourite latex debugging route.
- When using packages, one does encounter hickups, but no surprise here for long-time latex users.
[1]: https://github.com/scalawithcats/scala-with-cats/tree/featur...
HTML with MathML may make a decent system as well; possibly with an XML source and XSLT for templating, which is apparently how OpenStax textbooks are composed (via CNXML, though that also has just a couple of rain frog pictures in its documentation repository -- seems to be a common pattern around typesetting systems).
Then there is troff with eqn(1), which looks simpler, but not sure if there is an actual specification for it around, either.
And then there are Texinfo, org-mode with LaTeX embedding, other TeX-adjacent options, perhaps Markdown with HTML and MathML embedding.
I then discovered typst and it is a breath of fresh air. Unicode/Dēvanāgarī support out-of-the-box, no installing gigabytes of packages, near-instant compilation.
My complements to those who got this done.
Looking at the example in the link, in principle it looks great. But one of the strengths of latex is that I can customize things. Like for the list example, I can have fine tune control over the indent on both sides, the list marker symbol, the space between the marker and the text, and so on and so on. Does typst have this level of control?
It seems that part of the design philosophy of Typst is to make more assumptions about what the user is trying to do. For example, apparently if the user wants "dif" to appear in a math formula, typing "dif" would instead produce a differential -- although I presume there is some easy way to handle this.
Anyone who has used Typst -- did this potential disadvantage materialize in any way which was at all significant? Or did it turn out to be a nonissue?
But I will say I've mostly written relatively simple documents in it, so maybe that colors my experience.
Like other academics, I plan to stick with latex for journal articles and books, unless publishers provide support for typst.
Markdown still has a place for files on github, because that means that web browsers will display formatted material, not just the raw code. A similar thing applies to code documentation, with many systems (R, Julia, etc) supporting various flavours of markdown.
I recommend typst to students for small tasks like assignments. It offers more typesetting power than markdown, it's a great replacement for msword, and it's easier to learn than latex.
Long story short, typst fills a niche. But it's not the be-all and end-all, at least in my (natural science) field.
Not having to deal with the insanity of the LaTeX distribution system alone is worth the switch. Everything is contained in a single binary. The language itself is much simpler to read and write, and seems just as flexible. LLMs do a decent job of generating it. Compilation takes less than a second, making it so much faster to iterate.
Many thanks to the authors and contributors, and please don't ruin it. :)
So asking the community here: what does Typst offer in place of PGF/TikZ[1], PGFPlots[2], Asymptote[3], chemfig[4], siunitx[5], physics2[6], and how does it work with existing bibliography providers? I use biber[7] with the Zotero Connector and Better BibTeX[8] so any paper I visit on the web is essentially instantly available to cite with one click on LaTeX.
A good test for Typst ought to be reproducing most of these typographic and diagrammatic exemplars: https://tex.stackexchange.com/questions/1319/
[1]: https://tikz.dev/
[2]: https://tikz.dev/pgfplots/
[3]: https://asymptote.sourceforge.io/
[4]: https://mirrors.ctan.org/macros/generic/chemfig/chemfig-en.p...
[5]: https://mirrors.ctan.org/macros/latex/contrib/siunitx/siunit...
[6]: https://mirrors.ctan.org/macros/latex/contrib/physics2/physi...
[7]: https://mirrors.ctan.org/biblio/biber/base/documentation/bib...
Almost nobody wants to learn something new when they already know something similar.
Creates a heck of a momentum effect, not just from the practitioners resisting the change, but also available resources and so on.
The absolute staying power of TeX has been incredible.
The output is superb though, which is why everyone in academia keep using it. It’s just the tooling that is poor.
I think it needs to be modernized.
For once, the compilation time is terrible - it can take several minutes to compile a typical document. I recently tried to create a poster for a conference - a single A0 page - and even this took more than a minute to compile. Because positioning in images and figures in LaTeX is not obvious, this made iteration extremely slow.
Additionally, by forgetting a single bracket, one can easily encounter cryptic error messages relating to boxes. In the past, I have also worked on LaTeXML (the LaTeX-to-HTML "converter" amongst other things being used to power ar5iv [1]). Even though this exposed me to some of (La)TeX's internals, it is still extremely difficult trying to decipher error messages.
Typst, on the other hand, is much faster when compiling and provides much clearer error messages.
For this reason, I also decided to write my 130-something PhD dissertation in Typst [2]. My university only provided a LaTeX and a Word template, but I ended up copying that in Typst extremely quickly. My thesis compiles in about 7 seconds on my laptop - I cannot imagine how long it would take had I chosen LaTeX instead. Not only that, when I showed an initial draft of my dissertation to my supervisor - also a decades-long LaTeX user - he could not tell that I wasn't using LaTeX.
I only really encountered one problem with Typst so far - citation styles. In particular, the alphanumeric style preferred by my field produced duplicate citation keys, making the output unreadable in printed form. But given all the other benefits Typst offered, I ended up switching to IEEE's citation style instead.
I am also hoping that Typst improves its HTML export - it is very barebones at the moment - but that seems to be in the works [3].
[1] https://news.ycombinator.com/item?id=36947004
For example, for the translations, I just made an object with every piece of text in a hierarchical structure, with the leaf being an object with keys for every language and the texts as values. Then I have a function called t() that is created after we already know the language for this report that just extracts the current language string when given an object like #t(content.section1.subsection.header.title) in the main report template (which imports this translations object from another file)
For bibliography references, I just have a regex for __REF\d+ that will replace all those references with real bibtex references.
On the plus side:
* Getting structured data into typst is sooo much simpler than into latex. For latex, you basically have to render a template, and have to know all the crazy escaping rules for special characters. In typst, you can just read a json file, and do the rendering in typst.
* Super fast. Love it.
* Mostly very easy to use.
Minus:
* Our invoices are structured as multi-page tables, and widow and orphan prevention in a multi-page table seems to be non-existent. The workarounds we tried were too disruptive (lead to text overlapping other text, for example).
* There's a bug in the Python wrapper that means we sometimes don't get a proper error message when there happens to be an error, then we have to recreate the scenario on the command line to find out what the error was.
* Docs could be better (but are mostly OK)
Overall I'm very happy with typst for this use case.
One thing I have not seen mentioned as yet: cross-references. In LaTeX, I can create cross references to anything: page number, table or figure number, even an item in a numbered list. Does Typst have that capability? I saw a package for cross-referencing numbered boxes (it's called statementsp), but it wasn't clear how you xref other things. (Not saying it's not there, it just doesn't jump out at me.)
Book: https://thelabofthought.co/shop/p/nbmi3
Bugs: https://github.com/jgm/pandoc/issues?q=is%3Aissue%20state%3A...
I've been using Typst for work documentation and hobby authorship. It is unreal how powerful it is out of the box, with no plugins. It's a Turing-complete programming language where you can switch between a code context and a document context with a simple change of brackets. Everything you WISH Latex did out of the box, it does. Highly recommend the VSCode plugin with live PDF generation and automatic scrolling.
In the past I have also used it to generates quotes (in terms of finances, invoice etc.). It was neat because all of the logic for adding up the subtotal was written in the language (and was fairly easy to understand). I can imagine trying to do that logic in LaTeX…
Probably our best solution is to decide that we don't care about nearly pixel perfect reproduction of the contract, which probably makes a switch to typst a lot easier.
It replaces the macro language of LaTeX with a python/rust like language, which couldn't be easier to write.
The markup language has a markdown like syntax which makes writing simple things simple. And allows for complex, but easy to comprehend operations when useful.
It has good tooling, with helpful error messages and is not arbitrarily limited on memory or font support. (I know some LaTeX engines do not have that problem anymore, but even the Idea of competing engines with different feature sets is somewhat ridiculous)
I have used it a lot, for many different things.
While I appreciate LaTeX structure, and the resulting end product (Knuth is God), it is as you know highly verbose in markup, thereby making the content somewhat unclean, and not easily readable like plain text (my yardstick on content readability and re-usability). I wrote multiple plug-ins for the text editors of my choice Sublime Text, and Vim to produce snippets for writing ease.
- https://github.com/ckunte/latex-snippets-st
- https://github.com/ckunte/latex-snippets-vim
Switched to Typst cautiously in 2023, and have never since looked back. If LaTeX was the gold standard for the 20th century, I think Typst is on track to become that for the 21st.
I wrote a little note about writing a template for Typst to remind myself how-to, and for anyone I'm working with:
We should just use human friendly markups like MyST Markdown [1] or Org Mode [2].
Unfortunately, whitepapers are predominantly written in LaTeX. Thankfully, arXiv recently made a move to parse and render those documents in the web format. It's a hard job. But this is the wrong way around: instead of keep composing documents in LaTeX (which is not human friendly), and then doing the hard job with tooling, we should start with human first approach and have win-win!
We are living in the world where web content is the primary content and friendly for desktop, mobile devices and readers and tools (select, copy, edit...). It's easy to package any web content into epub and ship it in a single file. Printing is also easy. Only cons: precise typesetting is not harder. But this is less of the problem. I would prefer a content that is friendly to read and is responsive, than a precise typesetting.
[1] https://mystmd.org/ [2] https://orgmode.org/manual/Summary.html [3] https://info.arxiv.org/about/accessible_HTML.html