Live data from Hacker News

Exploring Typst, a new typesetting system similar to LaTeX

blog.jreyesr.com

151–160 of 243 posts

Re: Exploring Typst, a new typesetting system similar to LaTeX

#151

I've moved all of my LaTeX-based content creation to Typst. It's: - Fast—Compiling my books would take around 1 minute (I often had to compile twice due to indexing). With Typst, it takes less than 5 seconds. - Easy to write—I actually don't write it, I wrote a bunch of Pandoc plugins to tweak the output from Pandoc (I write all my books in Jupyter these days, so lots of markdown). - Easy to read—I've used LaTeX for…

Regarding math stuff and graphics/diagrams, it works well too.

What I enjoy about Typst is the fact that the code is easy to write and read. Even code from some third-party library or template is easy to understand. There is a world of difference between this and LaTeX, which abstracts over TeX, and whose inner workings remain obscure even to experienced developers having used LaTeX over decades for tens of documents.

The compilation of Typst documents is indeed also extremely fast compared to LaTeX.

The runtime and libraries are lightweight and easy to install, compared to LaTeX distributions.

Writing custom logic or even a fully-fledged template with Typst is easy to do from day one.

The only reason I still see to use LaTeX nowadays is writing books and papers whose editor only accepts LaTeX.

I've switched to Typst some months ago and not once have I thought it might have been a mistake. The only thing I regret is that there is no automatic migration of older LaTeX documents to Typst.

Editors still have to be improved, though the Vscode plugin is absolutely usable.

Re: Exploring Typst, a new typesetting system similar to LaTeX

#152

C-f r u s t RET But of course. I'd rather see effort go into improving LaTeX performance instead of creating some new incompatible thing in a trendy language. One could also imagine an Elixer-style "resyntaxing" of LaTeX that would preserve compatibility with decades of packages. I don't think a long-developed ecosystem should be given up lightly.

Speed and nice error messages in (La)TeX, and to some extent ease of programming, are entirely doomed because of fundamental design choices. Being based on unhygienic macro expansion means that there is only one way to evaluate (the slow way), there will never be incremental compilation (everything can possibly be stateful in horrible ways), there will never be good error messages because there's basically no AST information anywhere (begin/end is a joke).

Regarding ecosystem: tons of undecipherable LaTeX packages are basically one-liners (ok, 10 liners) in typst. I know it from experience: I've written my PhD manuscript in typst. So perhaps one reason why there are so many (basically frozen) packages in LaTeX is because they are so hard to write and maintain.

edit: of course, being only a few years old, typst is nowhere near as solid as TeX, but you can already use it for a lot of things and its a breeze to use.

Re: Exploring Typst, a new typesetting system similar to LaTeX

#153
In the near future, I'll have to program the document generation part of an invoicing system.

In the past, I've done generated PDF documents through latex, and didn't really like the process (for one, escaping is just so weird in latex, \ to \textbackslash for example).

I've thought about generating HTML and using a headless browser that can produce PDFs for me, but I don't know how well you can e.g. control page breaks with CSS these days.

Maybe typst is actually a good alternative here? Does anybody have experience with typst and multi-page tables?

Re: Exploring Typst, a new typesetting system similar to LaTeX

#154
I'd like to throw my two cents into the "my experience is limited but I like it better than LaTeX" ring. Because, in my limited experience, Typst is easier and faster than LaTeX by a lot.

I'd like to emphasize how important it is that Typst is a collaborative web-app like Overleaf-- 100% of the LaTeX use I saw in academia was on Overleaf.

Re: Exploring Typst, a new typesetting system similar to LaTeX

#155

Earlier quoted context omitted.

Latex workshop gives an identical experience with latex

Yeah I think its fair to say latex has a much more mature ecosystem. And we should expect nothing less from something made in 1985. Its almost 40 years old. But typst is catching up as fast as it can. I find it very usable already.

Yeah, my guess is that it'll fall on either side of the same go/c vs c++/rust "simple rules with more implicit rules in your head" vs "complex tool with less in your head" divide in people's opinion.

Re: Exploring Typst, a new typesetting system similar to LaTeX

#156
post #95
post #82

References in established systems like LaTeX work the way they do for a reason: you don't want to embed words in them (like "Figure" or "Section") automatically because it does not work across languages. Eg. both the article and docs at https://typst.app/docs/reference/model/ref/ use an inline reference that wouldn't work in Serbian. Serbian (and many other languages) have suffix declensions, so while "Figure 4" is "…

Hopefully they'll improve the reference system and multilingual support. But if you want a simple number for a reference, you can call "ref( , supplement: none)", or if you want this to be the default for the @label shorthand syntax you can set it globally with "#set ref(supplement: none)". Also typst knows the type of the referenced element. It's easy to write more elaborate rules that behave differently depending o…

I played with this briefly, and saw that supplement can also take a function, which presumable how you make @wibble return '(34)' instead of 'Equation 34'? The function is passed the equation itself, so supplement: x => x makes the reference identical to the whole equation (!), but it wasn't obvious to me how to extract just the equation number from an equation x?

This is a really common idiom in mathematical writing: "from (1) we see that..." instead of "from Equation 1 we see that". (Randomly capitalising 'Equation' here is another controversial implication of using a fixed word string as a supplement.)

Re: Exploring Typst, a new typesetting system similar to LaTeX

#157

I like Typst, but I've had a couple issues so far: 1. The line spacing. It's not defined as baseline to baseline, but as the space inbetween two lines of text. Very difficult for an assignment with a prescribed line height since it usually refers to a baseline-baseline measure. 2. While having multiple columns is really easy, adding floating elements for the text to wrap around seems not possible. There's a reason al…

https://github.com/typst/typst/issues/4224 This issue and others like it are dealbreakers for me. There are numerous related issues, but the developers are stubbornly sticking to their interpretation—using the older definition of leading from the days of metal type, rather than the more modern concept of line-spacing. No other software or modern typesetting system I know of uses this approach anymore. This is particu…

I gotta say though, Typst is powerful enough to implement a custom line spacing. Using the measure command you can get the height of the current font and use that to automatically convert. It's just cumbersome.

Re: Exploring Typst, a new typesetting system similar to LaTeX

#158

In the near future, I'll have to program the document generation part of an invoicing system. In the past, I've done generated PDF documents through latex, and didn't really like the process (for one, escaping is just so weird in latex, \ to \textbackslash for example). I've thought about generating HTML and using a headless browser that can produce PDFs for me, but I don't know how well you can e.g. control page bre…

I'm doing PDF document generation in typst, the format I'm generating is similar to invoices (specific to how the law in my country is, but that's a longer story).

Typst code generation was easy to automate with trivial python templates (jinja2). The core part of my document are multi-page tables, and typst splits them nicely.

I had to google around a bit, as there are multiple settings on how large tables are handled, I suggest that you give Typst a try, you can build a working prototype in no time

Re: Exploring Typst, a new typesetting system similar to LaTeX

#160

In the near future, I'll have to program the document generation part of an invoicing system. In the past, I've done generated PDF documents through latex, and didn't really like the process (for one, escaping is just so weird in latex, \ to \textbackslash for example). I've thought about generating HTML and using a headless browser that can produce PDFs for me, but I don't know how well you can e.g. control page bre…

I have been building tools for document generation out of templates using Typst for a few months. It works great!

So far, I haven't found any bigger issues with multi-page tables in Typst. For example, it was no big deal, to get subtotals in an invoice for every page break.

Post reply on HN