13 ms·
It's great to see Typst getting more visibility. We migrated a real-world workload to it a couple of years back: generating and e-mailing 1.5M+ PDFs daily at my
by mr-karan 1y ago
It's great to see Typst getting more visibility. We migrated a real-world workload to it a couple of years back: generating and e-mailing 1.5M+ PDFs daily at my org, Zerodha.
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 https://zerodha.tech/blog/1-5-million-pdfs-in-25-minutes
- lupire 1y agoFor your use case, why were you using LaTeX in the first place? That is more surprising than finding a replacement for LaTeX.
- xigoi 1y agoWhat else would you use to generate PDFs from a text-based template?
- jayknight 1y ago20-ish years ago I wrote a system to do that with xslt. Would not recommend.
- sixtyj 1y agoE.g. Pandoc, universal tool…
- xigoi 1y agoDoesn’t Pandoc just use LaTeX under the hood?
- dfc 1y agoYou will be surprised to learn that pandoc uses latex for generating the PDF. It's barely hidden: https://www.pandoc.org/demo/example33/2.4-creating-a-pdf.html https://www.pandoc.org/demo/example33/2.4-creating-a-pdf.htm...
- __mharrison__ 1y agoPandoc works with typst too.
- smartmic 1y agoDITA, see my other comment on level up.
- spider-mario 1y agoReportLab?
- chromanoid 1y agoA good XSL-FO impl with docbook or something like that?
- henrebotha 1y agoAsciidoctor?
- Iwan-Zotow 1y agoDocbook
- pepa65 1y agoApart from typst, I've used weasyprint.
- Etheryte 1y agoIf you're compiling millions of documents, many with thousands of pages, you probably need something very universal. LaTeX is boring tech, off the shelf, ready to use. It might take some work to figure out the initial setup with regards to templating and everything else, but after that, you can be generally pretty content that it will handle most things you throw at it just fine.
- constantcrying 1y agoLaTeX is notoriously bad at being boring tech. It has a lot of very rough edges, especially when it comes to longer documents.
- ab5tract 1y agoAnd yet this very post positions Typst as a potential alternative to LaTeX. In other words, LaTeX is still in the top position. Personally I think ConTeXt is a far superior tool, though its documentation is always trailing quite a distance behind its current capabilities.
- sixtyj 1y agoI’d suggest LaTeX because of its strengths with tables, mathematical notation, and similar content. LaTeX notation works well for this and can be easily converted to both web and PDF formats. But compilation speed definitely needs improvement. On the other hand, how often do you actually need to compile thousands of pages into a single document? That’s really an edge case.
- smartmic 1y agoI am currently preparing to switch to DITA. The learning curve is steeper at the beginning, but I find the overall concept of topic-oriented, information-typed authoring with content reuse very attractive. Some people might say that writing in XML is annoying, but it isn't if you have a decent XML editor. In my case, it is Emacs nXML mode. Customisation is possible with DITA-OT [1] and plugins, and yes, it is also based on XSLT. Overall, I think DITA is an industry-proven XML powerhouse. It may be boring, but it has huge potential for anyone with advanced documentation requirements. [0] https://dita-lang.org/dita/archspec/base/introduction-to-dita https://dita-lang.org/dita/archspec/base/introduction-to-dit... [1] https://www.dita-ot.org/ https://www.dita-ot.org/
- Archelaos 1y agoI am using a LaTeX pipeline for creating text, invoices, forms, etc. from snippets stored in a database. It was quite complicated to set up, but the results are very satisfying. In principle, I would like an easier markup language, but am afraid to wast my time trying out something new, just to run into limitations after awhile. 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?
- __mharrison__ 1y agoI haven't done pictures in columns but the rest should be doable. I've migrated my invoicing (and all my other publishing/slides) to typst from latex and couldn't be more happy.
- jijijijij 1y agoNow, this isn't really an alternative, but I can recommend using pandoc instead of pure LaTex. Personally, I think text blocks are much easier to handle and read in markdown and pandoc allows you to use in-line LaTex wherever markdown is insufficient, without making basic text styling unnecessarily verbose. In my opinion, the result is a better/friendlier LaTex, or limitless markdown respectively. Especially for writing papers and such, you can always start actually writing in basic markdown, which is trivial and almost-WYSIWYG, and later worry about presentation. In my experience, with pure LaTex you easily get lost in sidequests and it's much harder to get into a writing flow and find your way around your own words in the editor.
- henrebotha 1y agoIf you're going to do this, might as well go with AsciiDoc instead. It's vastly superior as a syntax. Markdown breaks down at the mere mention of something as trivial as a nested list item containing a table of blockquotes.
- lloydatkinson 1y agoI’ve worked places that will regularly send generated PDFs of things like statistics or small reports or other generic boring business stuff every week or month. 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?
- tempest_ 1y agoWe are a python shop and use WeasyPrint. It works well for invoice type things. I suppose it depends on how much web dev experience is on hand.
- rtpg 1y agoSame, used to work at a place that used to use ghostscript + chromedriver and went to Weasyprint. Weasyprint is quite wonderful, fast, and you can file upstream tickets and get good clarity on what's going on. And you're writing your templates in CSS + HTML, which generally flows well. At the end of the day the problems are rarely "CSS + HTML vs Latex vs Typst", but more just about making decisions about how you want something to be laid out when you have dynamic input. "What should happen when I have a huge blob of text here" is often a non-trivial question. "What should I do on a page break here" is a non-trivial question. And they often involve having to, at the high level, make decisions. People whine about CSS, sometimes you just gotta read the spec and figure things out (rather than stop at your intuition for how certain fields work). Nice thing about CSS + HTML is you can open up your output in a browser and futz about with it very easily.
- commandersaki 1y agoWould you be able to post a sample/mock of a document that you produce, would be very interesting.