Live data from Hacker News

Typst: A Possible LaTeX Replacement

lwn.net

21–30 of 390 posts

Re: Typst: A Possible LaTeX Replacement

#22
Typst is just wonderful, I hear maths majors now procrastinate on thesis writing by writing typst packages instead. Give it ten years and see how it developed.

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.

Re: Typst: A Possible LaTeX Replacement

#23

Assuming it's at all desirable, it's an interesting and recurring problem of how to dislodge existing sub-optimal (sometimes even harmful) standards and notations. 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.

If the software is actually good, it can start from an enthusiastic core of students, PhD students and later niche conference organizers and niche journal editors and if they gossip about their experience, it can spread through word of mouth if it's sufficiently good.

Re: Typst: A Possible LaTeX Replacement

#24
I must say I really like the more straightforward syntax, semantics, and distribution model of Typst. LaTeX is akin to programming with the C preprocessor, it's both ridiculous and amazing what people have done with it but it gets quickly intractable. However, I really do enjoy the quality of graphics, diagrammatic, and scientific output from LaTeX, even if typing them is a pain (LLMs are a huge help here).

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...

[8]: https://retorque.re/zotero-better-bibtex/

Re: Typst: A Possible LaTeX Replacement

#26
I have written a couple of lecture notes in LaTeX and I wrote my master's thesis (mathematics) in LaTeX as well[1]. It's actually a fine language if all you want to do is write and rely on other people's templates. But actually writing my own package or understand how the underlying systems work has always seemed like black magic where individual packages have to avoid stepping on each other's toes, or add specific workarounds. Maybe I'm wrong, but that's the impression I got.

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.

Re: Typst: A Possible LaTeX Replacement

#27
Tex doesn’t attract software developers. The programming language has remained really old fashioned and clunky. The error system is particularly bad. I use it on a daily basis, and it doesn’t feel nice, far from the experience with Python or Rust.

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.

Re: Typst: A Possible LaTeX Replacement

#28

Earlier quoted context omitted.

> Almost nobody wants to learn something new when they already know something similar. I think it depends on what the thing is. I use LaTeX for occasional documentation, a better version would save me a maximum of 5 minutes a year. I probably won't be an early Typst adopter. But, I spend loads of time for example, working with dataframes in Python. I got into Polars fairly early because improvements in that space can…

> If you're routinely using LaTeX to write papers, the time spent learning something new isn't comparably large. I don't know. By then aren't you quite comfortable with LaTeX? It may be Stockholm syndrome and sunk costs speaking, but I'm using LaTeX all the time: I quite like it and I don't feel any need for something else to replace it...

Text editors progress one funeral at a time.

Re: Typst: A Possible LaTeX Replacement

#29
post #18

These are some notes I wrote when I started out with typst when comparing with LaTeX: 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 vi…

8. Programming with it is lovely. Its got a little interpreted language built in, with helper functions like json("some_file.json"). I wrote a paper in it, and used that extensively to populate all my result tables. (Benchmark script -> JSON files -> typst compiled the results directly into the PDF).

Have you compared this to using lua in lualatex?
Post reply on HN