Live data from Hacker News

Typst: An easy to learn alternative for LaTex

github.com

41–50 of 192 posts

Re: Typst: An easy to learn alternative for LaTex

#41
post #35
post #24

LaTeX is not just a set of macros over TeX to produce (nowadays) some pdf, it's a very big library of ready-to-use packages for pretty anything, that's VERY hard to "substitute". You want inspiration for some strange table layouts? There are gazillion ready made; some graph? TiKz/PGF have gazillions of ready made examples... Want a programming language in the middle? Python, Lua etc can be embedded straight away. So…

Exactly. It's not too difficult to imagine replacing LaTeX for some fairly straight-forward documents. But just by casually browsing tex.stackexchange.com, you'll soon find out that people use LaTeX for an amazingly wide range of different things, and it's capable of serving many, many edge cases very well. To be on par with that is a very hard goal. Let's not forget, LaTeX has been around forever, and consequently h…

I mean, the same is true for Emacs. But that hasn't stopped other editors (e.g. VSCode) from developing large vibrant communities of users and tooling.

Re: Typst: An easy to learn alternative for LaTex

#43

Typst has been pretty amazing, and at my organization, we’re very happy with it. We needed to generate over 1.5 million PDFs every night and experimented with various solutions—from Puppeteer for HTML to PDF conversions, to pdflatex and lualatex. Typst has been several orders of magnitude faster and has a lighter resource footprint. Also, templating the PDFs in LaTeX wasn’t a pleasant developer experience, but with T…

This is a really great write up. Kudos for the obvious effort, both on the technical side and sharing the process with the rest of us.

Re: Typst: An easy to learn alternative for LaTex

#44

Earlier quoted context omitted.

As someone who almost never needs equations, does this have any benefits to me over using markdown?

With or without equations, just use MonsterWriter. It gives you LaTeX results without needing to know what LaTeX is. But, yes LaTeX has other benefits, e.g. citing references, or creating PDFs according to layout and typesettings best practices.

It is customary to add a short disclaimer when you're promoting your own product or project.

Re: Typst: An easy to learn alternative for LaTex

#45

I'm surprised to see that HTML output is currently in progress, and was not a core feature from the start. [0] LaTeX's awkward relationship with the web seems like something a competing greenfield project would try to nail right out of the gate (to mix metaphors painfully). [0] https://github.com/typst/typst/issues/721

Yes, latex's HTML output is fairly good nowadays, after a lot of people made very heroic efforts to put it in a system never intended to support it.

Starting a new markup system with no plan for making accessible documents was, in my opinion, a very bad idea. I refuse to use typst until it can produce accessible documents.

Re: Typst: An easy to learn alternative for LaTex

#46

I guess this is a competitor to services such as overleaf [1] and codimd [2]. Although this is yet another syntax, it seems to be supported by pandoc [3]. Lately, I have been using Quarto [4] more and more as I program in R, which also produces very nice outputs, especially HTML. But none of these solve the academic usage problems of (1) producing nice diffs for reviewers, and (2) can easily be shared with, and comme…

I've been using quarto a lot too. I've found the typst pdf travel output to be a bit rougher than latex pdf when using GT. Hopefully something that will get fixed.

Re: Typst: An easy to learn alternative for LaTex

#47

Having composed many pieces of coursework using Typst, I must say that it certainly makes academic writing more streamlined, engaging, and dare I say fun — though that might just be me. The functional nature of Typst's syntax ensures I don't have the erratic behaviour emblematic of modern day Microsoft Word and sometimes even Google Docs. Using a local IDE such as VSCode brings all the features one could like. In com…

As someone who almost never needs equations, does this have any benefits to me over using markdown?

You've had some good replies already, but just want to add my thoughts. Markdown to me is more about (a) the content (the actual words) and (b) the semantics (text emphasis, headings, etc, which communicate information about the importance or meaning of particular things).

Typesetting systems like Typst or LaTeX go beyond this. They're also about presentation, how precisely it is laid out, on mediums such as print or PDF. Is that something you need? If you care more about the content and its meaning, and are happy to have it rendered differently in different situations (a preview in Visual Studio Code, or passed through a markdown-to-html renderer, or viewed in Obsidian, etc), then Markdown might not just be fine, it may be preferable. But if you need to do things like print this on paper for mailing, email in a PDF, that sort of thing, then you'll want something more.

Re: Typst: An easy to learn alternative for LaTex

#48
post #14

I can't wait for LaTeX to go away in favor of Typst. The experience is night and day. Very impressed with their work. I've been using Jinja2 templates to generate TeX files, but Typst can take a JSON over the command line and is easy to use and powerful enough that I can completely remove the Python step. Not to speak of the compile time that is measured in milliseconds.

Yes, the scripting is very nice. At first, I played around with Go templates to generate the Typst templates, since that is what I was used to doing with LaTeX. It was very nice to discover it allows you to use JSON with its scripting engine directly pretty easily.

Re: Typst: An easy to learn alternative for LaTex

#49

I'm surprised to see that HTML output is currently in progress, and was not a core feature from the start. [0] LaTeX's awkward relationship with the web seems like something a competing greenfield project would try to nail right out of the gate (to mix metaphors painfully). [0] https://github.com/typst/typst/issues/721

I assume you know that tex predates the web by many years?

Re: Typst: An easy to learn alternative for LaTex

#50

Having composed many pieces of coursework using Typst, I must say that it certainly makes academic writing more streamlined, engaging, and dare I say fun — though that might just be me. The functional nature of Typst's syntax ensures I don't have the erratic behaviour emblematic of modern day Microsoft Word and sometimes even Google Docs. Using a local IDE such as VSCode brings all the features one could like. In com…

FWIW there is already partial LaTeX support for Typst via the mitex package: https://github.com/mitex-rs/mitex

This is interesting! However, I suspect general TeX support in Typst is probably impossible unless you re-implement the entirety of TeX within Typst somehow. The TeX language has some really terrible properties. For example, the tokenization rules can be dynamically changed at runtime based on the output that has already been produced. E.g. you can write a TeX file that says "typeset this paragraph, and if the result is an odd number of lines, change the meaning of A from letter to open brace". Thus, fully supporting TeX within Typst would seem to require making all of the internals of Typst available to the TeX runtime.
Post reply on HN