Live data from Hacker News

Typst: A Possible LaTeX Replacement

lwn.net

141–150 of 390 posts

Re: Typst: A Possible LaTeX Replacement

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

This is probably not useful for most people, but I wrote a little script for Emacs that lets me write TeX-style math in a comment and then render/update it below in MathML: http://sdf.org/~pkal/src+etc/mathml-from-tex.el. The translation itself is done by LaTeXML, which one must install on your system separately.

Re: Typst: A Possible LaTeX Replacement

#142
post #139

If Typst would also allow to create HTML it could become a successor of LaTeX. Without it it is just another kind of LaTeX, created for printing stuff on paper. But that is not what a digital future needs.

Theres experimental support for HTML export:

https://typst.app/docs/reference/html/

Re: Typst: A Possible LaTeX Replacement

#143

As a long time latex user, and one who is occasionally frustrated by usual things about latex, I have two qualms about attempting to switch to a new system. The first is I already have found solutions to many of my edge cases in latex. Will I have to do this all over again in something like Typst? It can't be so good as to not have any. And when I do encounter them, is the user base big enough to have already encount…

Same boat here. It’s a very good layout language. And vastly superior production process. Will you find new edge cases? Yes. Is there a large user base covering all problems? No. You can add: “Does Claude Code understand it well enough?” No as of a year ago, last time I checked.

Yesterday I had Claude write me a simple 3d renderer using the CetZ package (typst’s Tikz) to draw illustrations of surfaces for a math paper. It pretty much nailed it.

Re: Typst: A Possible LaTeX Replacement

#144

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…

Actually, you can’t specify macros anywhere. Unlike TeX, it’s a real honest-to-goodness programming language with functions and types and modules (yes! It has namespaces!) instead of just macros on macros on macros.

It’s not perfect, they definitely made some interesting choices here and there, but this makes it ~80% less painful than TeX when you’re doing anything other than happy-path undergrad-lab-report writing.

(To be clear, I know you know this! I’m writing this for the benefit of all sentient beings :))

Re: Typst: A Possible LaTeX Replacement

#145

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…

> 5 bloody files

For those that have to use latex for various reasons, but absolutely hate these files from intermediate compiler passes, here are two aliases from my .bashrc

  latexloop() { latexmk -pdf -pvc -emulate-aux-dir -aux-directory=/tmp/latexcrap "$@"; }

  alias latexmk='latexmk -pdf -emulate-aux-dir -aux-directory=/tmp/latexcrap'
You can now `latexmk file.tex` and it will put all the auxiliary files in /tmp/latexcrap.

The `latexloop file.tex` invocation is just a helper that hot-reloads when you save the tex file.

Re: Typst: A Possible LaTeX Replacement

#146
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?

ReportLab?

Re: Typst: A Possible LaTeX Replacement

#147

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…

I 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 col…

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

Re: Typst: A Possible LaTeX Replacement

#149
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…

You footnote really describes why latex was not fine. I recently wrote a thesis in typst. I have written other thesis in latex. In latex i actually wrote in markdown and compiled to latex. I don't need that for typst. If typst can avoid enshittifaction over the next years, then I will stay with them.

You can still write in markdown and use pandoc to create typst.

Re: Typst: A Possible LaTeX Replacement

#150

As a long time latex user, and one who is occasionally frustrated by usual things about latex, I have two qualms about attempting to switch to a new system. The first is I already have found solutions to many of my edge cases in latex. Will I have to do this all over again in something like Typst? It can't be so good as to not have any. And when I do encounter them, is the user base big enough to have already encount…

Same boat here. It’s a very good layout language. And vastly superior production process. Will you find new edge cases? Yes. Is there a large user base covering all problems? No. You can add: “Does Claude Code understand it well enough?” No as of a year ago, last time I checked.

I've had decent results from AI for typst.
Post reply on HN