Live data from Hacker News

Typst: A Possible LaTeX Replacement

lwn.net

101–110 of 390 posts

Re: Typst: A Possible LaTeX Replacement

#101
post #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 w…

> It would be nice if Typst could be a LaTeX replacement that makes actually layout and designing the document approachable Those goals fall way out of the scope of LaTeX (and of course of Typst). If you want to have more control and power into a document's design, there's ConTeXt - as a graphic designer I just love it and can't imagine myself replacing it with LaTeX or Typst. But as you said, if you want to concentr…

I have hear of ConTeXt, but never tried it. I originally wanted to write my resume in LaTeX, but I quickly realized that my choice was either to use a template and have a resume that looks like everyone else's, or dig deeply into the arcane working of TeX. In the end I had my sister do it in InDesign, but now she is the only one who can update it. I would love to remake it in something I can actually edit myself, whether ConTeXt, Typst or Sile.

Re: Typst: A Possible LaTeX Replacement

#102

I’ve used neither Latex or Typst, but how are they at producing accessible PDFs?

They aren’t fully compatible yet but there is a lot of work going on now because of the new EU legistlation. LaTeX is closer.

E.g

https://github.com/typst/typst/issues/133

https://www.latex-project.org/news/2024/03/27/PDFUA2-example...

https://latex3.github.io/tagging-project/

Re: Typst: A Possible LaTeX Replacement

#103

Earlier quoted context omitted.

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.

Yeah I think this is correct, with the added caveat that it must be as good as the alternative PLUS the awkwardness of switching to have any hopes of breaking out of the local minimum. Otherwise you become Dvorak, which despite being better than Qwerty and having been around for almost a hundred years, still hasn't seen widespread adoption, in this case because the awkwardness of switching is very significant. The ef…

Dvorak is only slightly better than Qwerty at most.

Re: Typst: A Possible LaTeX Replacement

#104
post #94

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…

For your use case, why were you using LaTeX in the first place? That is more surprising than finding a replacement for LaTeX.

What else would you use to generate PDFs from a text-based template?

Re: Typst: A Possible LaTeX Replacement

#105

Typst is a markdown plug-in. It is a productivity tool. It lacks the standalone nature of LaTeX as a language and proper extensibility.

How does a project with a built in package manger and a wide variety of packages lack "proper" extensibility?

Re: Typst: A Possible LaTeX Replacement

#106
post #104
post #94

Earlier quoted context omitted.

For your use case, why were you using LaTeX in the first place? That is more surprising than finding a replacement for LaTeX.

What else would you use to generate PDFs from a text-based template?

20-ish years ago I wrote a system to do that with xslt. Would not recommend.

Re: Typst: A Possible LaTeX Replacement

#107

Almost all my computer science students are using Typst on my recommendation to write up their programming projects, vs most using Microsoft Word last year. Specifically, writing in VSCode with the Tinymist Typist extension. All going very well so far and no complaints.

I was with you when you explained how you got them off of MS Word (even worse if it was the web version!!), until you brought up VSCode. I get it, you are probably advocating very practical choices. Just that I wouldn't recommend students to become dependent on VSCode (due to its vendor and "telemetry"). Basically, that makes the students again dependent on MS. But I guess since you recommend an extension, you cannot…

There is a language server for Typst: https://github.com/Myriad-Dreamin/tinymist

I have not tried this one, but the predecessor (typst-lsp) was working fine with Neovim for me when I did my little Typst experiment last year. Whatever the VSCode plugin is offering should be possible to replicate on top of tinymist.

Re: Typst: A Possible LaTeX Replacement

#108
Typst fixes pretty much every problem LaTeX has.

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.

Re: Typst: A Possible LaTeX Replacement

#109
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).

As you wrote a paper, how difficult would you say is it to recreate the template of the venue you submitted to?

Re: Typst: A Possible LaTeX Replacement

#110
post #13

Among alternative typesetting systems, there is also SILE, which supports two syntaxes (XML-based and TeX-style), supports scripting in lua, comes with freely available sort-of-specification (unlike (La)TeX or Typst, unless one counts program sources as specification). For formulae, it additionally allows direct MathML input. I have not used either Typst or SILE though, only looked into their documentation. HTML with…

> HTML with MathML may make a decent system as well HTML is fine to write by hand (especially when you take advantage of tag omission [0]), but I can't imagine handwriting MathML, since even simple equations need lots of tags [1]. [0]: https://html.spec.whatwg.org/multipage/syntax.html#syntax-ta... [1]: https://en.wikipedia.org/wiki/MathML#Presentation_and_semant...

It is indeed considerably more verbose, especially the "context" version (the one focusing on semantics, rather than presentation), and I did not write much of it myself, but I can imagine it being fine. It should not be a bottleneck for carefully (and slowly) composed documents, while for more casual and quick notes, even with LaTeX it appears to be common to use both a preview (often inline) and some input assistance, avoiding completely manual handwriting. Besides, as the linked Wikipedia article mentions, it is rather like expressions in Lisp-family programming languages (or pretty much any common ones, if you avoid infix operators), which are not that bad. I imagine it may also be more convenient (and terse) in combination with SXML or KDL, to avoid closing tags.
Post reply on HN