Live data from Hacker News

I wrote my PhD Thesis in Typst

fransskarman.com

281–290 of 338 posts

Re: I wrote my PhD Thesis in Typst

#281
post #144

I have only two peeves with typst. 1. They should have carried forward the latex standard as-is for math, instead of getting rid of the backslash escape sequence, etc. 2. There is no way to share a variable across a file's scope - so can't have a setting that is shared across files - not even with state variables. Other than this, typst is solid, and with the neovim editor and tinymist lsp, is great to write with.

Regarding point 1: I'm so glad they didn't keep the math syntax, there's finally progress in math text input! E.g. we can now write $ ZZ &= { ..., -1, 0, 1, ... } \ QQ &= { p/q : p, q in ZZ } $ $ a = cases( 0 & quad x 0 ) $ instead of \begin{align*} \mathbb{Z} &= \{ \dots, -1, 0, 1, \dots \}, \\ \mathbb{Q} &= \left\{ \frac{p}{q} : p, q \in \mathbb{Z} \right\} \end{align*} \[ a = \begin{cases} 0 & \quad x \leq 0, \\ \…

> Regarding point 2: you can put your settings in a file `settings.typ` and import it from multiple files.

Let's say I have 3 flavors of settings and 10 different typ files - normally I'd just have 3 flavors of top.typ (top1.typ, top2.typ, top3.typ) with the correct settings for each flavor with settings proagated to all 10 files. Compiling top1/top2/top3 would then create flavor1.pdf, flavor2.pdf, and flavor3.pdf

Now how do I do it with settings1.typ, settings2.typ and settings3.typ? I have to go into the 10 different files and include the appropriate settings file! Or employ hacks like creating a common settings.typ using bash in the Makefile and including the common settings.typ in the 10 different files.

Edit: This is an actual use case - I'm helping with a resume, and have 3 different resume styles - a resume, a cv, and a timeline - and different files like education, work experience, honors, awards, publications, projects, etc and the level of detail, style, and what is included or not in each is controlled by which resume style is active. In latex I did this using \newcommand and the ifthenelse package.

In typst, I have had to resort to passing these global settings as arguments to functions spread across these different files, so each resume item (function) instantiated from the top file has a bunch of parameters like detail_level = 1, audited_courses = true, prefix_year = false, event_byline = true, include_url = true, etc., which make the functions unweildy.

Re: I wrote my PhD Thesis in Typst

#282

The initial motivation of LaTeX compile times being slow is very interesting to me. I use LaTeX as a tool for layout of books to print for hobby bookbinding and my current project - a 3 megabyte, 500k word beast of a novel - only takes around 10 seconds to compile. I cant imagine what the friend of the author here had going on in his paper such that his compile times took such a hit. Required use of specific LaTeX li…

PhD theses often have many figures, and these are often not optimised. My thesis is around 30MB, and that's after I optimised a couple of the most egregious figures. I'm planning to make it better in the corrections phase, but file size is really not something most people will be concerned in the writing phase, and so compile times are likely to suffer.

For further reference, a single-pass compilation of my thesis currently takes 25 seconds, and multiple passes are of course needed if the layout/bibliography changes. I ended up setting up TeXstudio to always compile only once for the preview, and then run the full N complications for the final build. That plus liberal use of \includeonly made compile times not that much of an issue

Re: I wrote my PhD Thesis in Typst

#284
post #256

Earlier quoted context omitted.

I've done some simple Typst programming via Claude, and it worked fine. I expected it to be ignorant of Typst but that was not the case. One of the best things about Typst is that most tasks are very simple. Compared to the reams of Latex BS I was replacing, building my book with Typst is momumentally simpler.

Sure but if the LLMs are making LaTeX easy to work with then why bother trying migrate everyone to a new language?

Because LaTeX is ugly to write and not human-friendly. Adding an AI agent to the loop does not fix those issues.

Re: I wrote my PhD Thesis in Typst

#285

Why do CS doctoral candidates have such a fascination with typesetting? I mean, be into whatever you’re into, I guess. But as soon as someone starts talking about LaTEX and how they spent months on their macros, I think “another hapless victim has fallen into LaTEX’s trap.” It’s like an ant lion that feeds on procrastinating students.

Here it's typical that a thesis will be printed as a book, and it's that book that will be evaluated. For PhDs, there's a doctoral defence in front of a committee, peers and other interested parties and they're all given the book. Usually the process for ordering books is that you send them a PDF with embedded fonts inside it, and it's made at the university's printing house. They will handle distribution etc. So you…

This answer makes sense to me, because it is rooted in a functional need - the need to have a printing house consume the results successfully.

Some other comments are oriented around aesthetics ("taste") or the state of other tools (Word, etc.) which I understand but those issues are more personal.

Re: I wrote my PhD Thesis in Typst

#286
post #277
post #271

We [1] have been using Typst to generate PDF documents in production for a few months, such as invoices and labels. It's generating thousands of documents daily, and I'm glad that some of them are printed and used by people in the warehouse who are doing real work. I really like the simple syntax that Typst provides. It would be much harder for the PMs to edit the templates if we went with other solutions, such as wk…

How have you found the generation performance? It seems like this should really be a perfect fit for this sort of use-case, and I'd hope the memory footprint and speed are all much more competitive than HTML-based approaches. The team I'm currently working with are using Gotenberg for things which we can afford to take a little while, and C#/Skia for things which need to be reasonably quick.

I only experienced a couple milliseconds for small documents of 15 pages or so. It’s reasonably fast to show the user the result „immediately“ on changes. Haven’t checked memory usage.

Re: I wrote my PhD Thesis in Typst

#287
post #198

Why do CS doctoral candidates have such a fascination with typesetting? I mean, be into whatever you’re into, I guess. But as soon as someone starts talking about LaTEX and how they spent months on their macros, I think “another hapless victim has fallen into LaTEX’s trap.” It’s like an ant lion that feeds on procrastinating students.

People who are fascinated with LaTeX are gearhead types. Just the same as photographers who care more about their cameras or chefs who care more about their knives.

The problem with gearheads is that they can displace their passion for the activity itself onto the gear around the activity...and get better at having gear but not get better at the activity.

E.g., guitarists who own 80 of the same guitar and spend many hours on the internet arguing about tiny variations in what Fender was doing in 1961. And then they put out a video and it turns out they can barely play guitar at all.

I wouldn't exactly criticize them for that choice, but it's definitely a choice. Or maybe not a conscious choice, because the road to improvement is hard, but the road to more gear is loaded with honeypots of dopamine.

Re: I wrote my PhD Thesis in Typst

#289
post #239
post #5

Earlier quoted context omitted.

The definition of insanity is doing the same thing twice and expecting different results. By coincidence, this is the basic way to compile latex.

Aren’t getting different results the norm in programming anyway? Developers usually don’t make the effort to include idempotency and make builds reproducible.

Normally, if you compile the same code twice on the same machine, you'll get the same result, even if it's not truly reproducible across machines or large gaps in time. And differences between machines or across time are usually small enough that they don't impact the observed behavior of the code, especially if you pin your dependencies.

However, with LaTeX, the output of the first run is often an input to the second run, so you get notably different results if you only compile it once vs. compiling twice. When I last wrote LaTeX about ten years ago, I usually encountered this with page numbers and tables of context, since the page numbers couldn't be determined until the layout was complete. So the first pass would get the bulk of the layout and content in place, and then the second pass would do it all again, but this time with real page numbers. You would never expect to see something like this in a modern compiler, at least not in a way that's visible to the user.

(That said, it's been ten years, and I never compiled anything as long or complex as a PhD thesis, so I could be wrong about why you have to compile twice.)

Re: I wrote my PhD Thesis in Typst

#290
I just want a a very simple Markdown like syntax to make a very basic resume with just few features that are not in Md:

- custom spacing - horizontal/vertical (after list dots/numbers etc as well)

- justifying the text

- custom margins

And for that something like this is an overkill. Less than Tex but still an overkill.

Hell, I can do with a flavoured markdown if it supports this.

Post reply on HN