Live data from Hacker News

Typst: A Possible LaTeX Replacement

lwn.net

261–270 of 390 posts

Re: Typst: A Possible LaTeX Replacement

#261

It's night and day. I'm a PhD student currently writing my thesis in Typst. On paper this is an absurdly risky decision: it's a new technology without a huge user-base, it's not totally stable yet, etc. But I tried Typst and I had no choice. It was obviously the right thing to do, even though I'm going to have to make a pixel-perfect clone of my university's LaTeX template. I've been using LaTeX for over ten years an…

Maybe the best compromise here is a markdown interpreter that converts to latex so you can use existing libraries and templates but not have to worry as much about syntax.

I don't think syntax is the problem here. Using some tool that transpiles to LaTeX, you'll still have to fight your TeX engine sometimes, but now you also add friction and gotchas of your tool that does transpiling.

I've tried writing Org and compiling it to LaTeX, but gave up this idea because ultimately I had to figure out idiosyncrasies of both LaTeX and Org-mode engines.

Re: Typst: A Possible LaTeX Replacement

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

Oooh that is nice. I have long relied on various conversion hacks to update data tables (mostly settled on pandoc markdown), but that little usability nugget is worth quite a bit to me.

Re: Typst: A Possible LaTeX Replacement

#263

Earlier quoted context omitted.

I've said that in Typst, when you're writing, it feels like writing, and when you're programming, it feels like programming. Whereas LaTeX always feels almost, but not quite, entirely unlike programming.

The primary feeling I get from using LaTeX is: fear. Any little special thing I adjust tends to break the document, or move figures, or fixing one thing breaks another and so on. And forget about changing templates.

My paranoid workflow is that I have to make many subdivisions of the document so that I can trivially enable/disable components when I am triaging a problem. When something breaks, I am less reliant on the garbage error messages.

So the top-level document is just a long list of inputs

  \input{intro}
  \input{prelude}
  \input{complex_figure1}
  ...
The side benefit is that I can disable all but the component on which I am directly working, so compilation is faster.

Re: Typst: A Possible LaTeX Replacement

#264

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…

Typst still does not natively support floating images. You can put images at the top of a page, or at the bottom, but there is no native way to declare an image as floating with text wrapping around it.

Re: Typst: A Possible LaTeX Replacement

#265

Earlier quoted context omitted.

Hey, I've had the same problem with duplicate citation keys! I couldn't find an issue on it. One of us should file a bug report.

I already did [1]. It got moved into hayagriva, which appears to be the library used to implement citation in typst. [1] https://github.com/typst/hayagriva/issues/255

Amazing, thanks!

Re: Typst: A Possible LaTeX Replacement

#266
> Another drawback is the difficulty of learning Typst. The official documentation is confusingly organized, with information scattered unpredictably among "Tutorial", "Reference", and "Guides" sections.

I would have thought that this method of organizing documentation is preferred, as I assumed The Grand Unified Theory of Documentation[0] was well known and liked.

[0] https://docs.divio.com/documentation-system/

Re: Typst: A Possible LaTeX Replacement

#267
I've written a system that consists of a JS front-end/backend, which then feeds a json object to a typst template to generate PDF reports with hundreds of pages, multipage tables, references to bibliography within the json strings, and translated to multiple languages. It works extremely well, and it's very intuitive to work with it.

For example, for the translations, I just made an object with every piece of text in a hierarchical structure, with the leaf being an object with keys for every language and the texts as values. Then I have a function called t() that is created after we already know the language for this report that just extracts the current language string when given an object like #t(content.section1.subsection.header.title) in the main report template (which imports this translations object from another file)

For bibliography references, I just have a regex for __REF\d+ that will replace all those references with real bibtex references.

Re: Typst: A Possible LaTeX Replacement

#268
post #172

Earlier quoted context omitted.

> I've been using LaTeX for over ten years and I still wouldn't say that I "know" TeX in any meaningful way. I was not only productive but proficient in Typst in a day or two. That's an interesting insight. Do you have an idea why this is? Do you have a CS background?

Yep, I'm a CS researcher in a top-3 department. (Hate to be all credentialist like that, but I'm guessing it does mean something to this audience.) I think a lot of the reason is that, ok, LaTeX is extremely complicated. We all know this. Its partisans tend to believe that this is because typesetting is a hard problem. Typesetting is a hard problem! We know this, too. But I think that a substantial fraction of the co…

I totally agree. I have written in LaTeX extensively and Typst is a game changer and a life saver. The community is also a plus. I love it and I will never go back to TeX.

Re: Typst: A Possible LaTeX Replacement

#269

Earlier quoted context omitted.

Ugh, unfortunately it means "please note that I'm not an unserious person." Very often when you have opinions on software on the internet, trolls will jump out of the hedgerow and shout, "who are you to have an opinion?" And, sadly, that same sort of person will often be mollified somewhat by prestige. Feels kind of icky to have written that, though, and maybe I regret it slightly.

It also belies an ignorance that some schools have specializations. Utah wouldn't come to mind as a "top-20" school by the snobs, but they basically created computer graphics.

[deleted]
Post reply on HN