by optionalsquid · 1y ago · 0 comments
- The Typst online editor is proprietary: https://typst.app
- The Typst compiler/CLI is open source: https://github.com/typst/typst
I hear that the online editor is quite good, but personally I've only ever used the CLI.
I originally picked up Typst as yet another replacement for PowerPoint (replacing my use of Marp), but have since used it for a poster and some minor text documents. And I've been very happy the results. I know that a lot of people love using LaTeX for that kind of thing, and with good reasons, but I always forgot most of the details between my (occasional) use of LaTeX, while I've found Typst to be very easy to return to
Interestingly, Knuth has stated that his development of Literate Programming:
http://literateprogramming.com/
was more important than TeX --- fortunately, his publishing _TeX: The Program_:
https://www.goodreads.com/book/show/499934.Computers_Typeset...
has been very helpful to folks developing successors and add-ons and new versions, facilitating the creation of web2c and change files which made tools such as pdftex and omega and xetex and luatex possible).
Maybe I was just unlucky or you had better luck with another model. But I was very surprised to here this because Typst is my chief example for a language that LLMs are bad at.
Claude did generated a rather good template for what I needed. It did not compile at first but I copy-pasted the errors and it fixed them.
Not all was good, though. It used literal bullets instead of `-` required for lists, but on whole the experience was positive.
It had taken me less time to fix the template than it would been taken to write it from scratch.
Something which Claude was good at. I throw him a crude ASCII "art" representation of what I want and get the right Typst code back.
You can't escape hallucinations, of course, but they can be mitigated somewhat. Don't ask it to generate a bunch of code at once. Feed it a snippet of code, and tell it precisely what you want it to do. These are general LLM rules applicable to any language and project, and I've had success with them with Typst. I also used it just to get explanations, or general ideas about how to do something, and then figure out the actual syntax and working code myself. It's strange that you haven't had luck with pasting docs. That has usually worked well for me.
I also think that LLMs don't struggle as much with Typst because the language is relatively simple, and there is little bad and outdated content about it online, so they weren't trained on it. I assume that the API probably hasn't changed as much either and there haven't been many compatibility issues, so it's not as important which version the LLM was trained on.
Interestingly, I've had the opposite experience. ChatGPT and Claude repeatedly gave me errors, apologized profusely, and then said, "ah, I had the wrong keyword. It's actually <blahblah>"--and that would simply give me another error and a subsequent apology.
At least Gemini had the good taste of telling me that it didn't know how to do what I wanted with typst.
It's certainly possible that I was trying to do something a little too unusual (who knows), but I chalked it up to the LLMs not having a large enough corpus of training text.
On the bright side, the typst documentation is quite good and it was just a matter of adjusting example code that got me on track.
> I chalked it up to the LLMs not having a large enough corpus of training text.
I'm inclined to believe the opposite, actually. It's not so much about the size of the training data, but the quality of it. Garbage in, garbage out. Typst is still very young, and there's not much bad code in the wild.
And the language itself plays a large role. A simple language with less esoteric syntax and features should be easier to train on and generate than something more complex. This is why I think LLMs are notoriously bad at generating Rust code. There's plenty of it to train on, but Rust is a deep pit of complexity and unusual syntax. Though it helps when the language is strict and statically typed, so that the compiler can catch issues early. I would dread relying on generated Python code, despite of how popular and simple it is on the surface.
I've also only used the CLI tool, and didn't miss any features from it. The commercial product was never pushed or promoted to me. I personally have no need for it, and I'm only vaguely aware that it exists. But I'm sure that people who do need the friendlier UI/UX and more advanced features would be willing to pay for it, so I'm glad that the team has a stable source of income that enables them to continue maintaining the project in the long-term.
Looking at the pricing page now... Wow, the plans are quite generous and affordable. Way to go!
I do find the web version handy to share Typst examples and on occasion work on a document while syncing with private Github repository.
Yes, many companies start with good intentions which then change at some point, but there have also been companies that have managed to successfully balance both sides.
Grafana comes to mind, as well as ClickHouse, and TimescaleDB. I'm not as familiar with the latter two, but Grafana is certainly a good example. You can probably find some blemishes even on their record, but overall, I would say they have been excellent stewards of OSS. Especially considering the large amount of products they maintain.
So far, Typst seem to be on the right track as well, which is worthy of praise.
https://isitreallyfoss.com/projects/typst/
It seems mostly fine except for this bit:
> The compiler includes a package manager “Typst Universe” that may connect to servers owned and operated by Typst GmbH
- Using CSS for formatting resulted in a lot of one-off rules, and was a lot noisier and less readable than the equivalent in Typst.
- The use of CSS for formatting also meant that the Marp compiler couldn't catch most of my silly mistakes. With Typst the compiler will catch those mistakes.
- Using a plugin to selectively highlight lines required writing a custom "engine" in JS, which was a pain to get working. Using a package in Typst is extremely simple.
- And I had to use npm to install the plugin in the first place. Typst comes with a package manager built-in.
- Generating PDFs required that I installed Chrome/Chromium. Typst does that out of the box.
The only place, that I can think of, where Marp is ahead of Typst, is with regards to generating HTML based presentations. But that probably won't be the case forever, and I personally always use PDFs for the final presentation, since that means that a lot less can go wrong. Especially so if I am not using my own PC when giving the presentation
Not alway, but often they required PDF output. Not always, but often they ended up being LaTeX based, with all the nice and some of the ugly consequences. Especially the security story was never great.
Does anyone know how hard it would be to integrate the Typst renderer into an existing Rust product?
I need to generate a 2 page invoice and i can generate it under 100 ms. IIRC, it's easier to integrate with rust. Since the pdf rendered is written in rust
I’ve also mainly used it for slides so far. Can recommend Slydst for that.
From what I can tell, Slydst seems intended for more minimalist slides. But it looks nice, so I'll have to keep it in mind for cases where I don't need the above template
But if you mean animations (including animated transitions), then I do not believe that it is possible in Typst, since the output it outputs PDFs. I also do not believe that it is possible to embed multimedia in a document.