Live data from Hacker News

Typst 0.14

typst.app

151–160 of 171 posts

Re: Typst 0.14

#151
post #150
post #17

> Meanwhile, in HTML and SVG export, PDFs are converted to an embedded SVG on-the-fly. And, finally, in PNG export and the web app preview, PDFs are rasterized. All of this PDF processing functionality lives right in the Typst compiler, with no system dependencies. This is only possible thanks to the amazing work of community member @LaurenzV, who created a new PDF processing library called hayro from scratch. The li…

> is thus highly portable Much less portable than the C ecosystem though.

> Much less portable than the C ecosystem though.

Theoretically? Yes. In practice...

Do you actually develop for a platform that (a) has a standards-compliant C compiler, (b) does not have a Rust target, and (c) has enough memory to be worth dealing with PDFs?

Re: Typst 0.14

#152

I love typst and I tried to use it recently when shipping publications to EMNLP, AAAI, and NeurIPS. While there were a lot of upsides to it, things got very bad when the teams grew beyond just a few people. Typst is incredible for single-person or a trio of people, but the web experience is not there yet for collaboration. I’m really hoping for typst to continue and I plan to use it whenever I can for smaller project…

> Typst is incredible for single-person or a trio of people, but the web experience is not there yet for collaboration

How did collaborate in the past on LaTeX publications?

Re: Typst 0.14

#153
post #41

Earlier quoted context omitted.

Speaking of skill, learning a new language is always daunting, but I found that LLMs do a pretty good job of generating Typst code. I relied on that a lot for generating snippets of code, and learning about the language, which would've taken me more time otherwise. Although the Typst docs are pretty good, regardless.

> but I found that LLMs do a pretty good job of generating Typst code. 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 "--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 ty…

Well, that just goes to show that these tools are wildly unpredictable. I've had bad experiences generating Go, whereas I've read many experiences of the opposite.

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

Re: Typst 0.14

#154
post #114

Earlier quoted context omitted.

isitreallyfoss.com did a break down on typst that goes more in-depth 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

So do most package managers...

I think most package managers take the repository urls from config, with typst its hardcoded in the binary (right?).

Re: Typst 0.14

#155
post #105

Earlier quoted context omitted.

This was a few months ago, but mainly Claude Sonnet 3.5 IIRC. 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…

It failed miserably with very simple requests. It was wrong but it wasn't clear if it was hallucinating or simply using old syntax. I did not try Claude though. Perhaps that performs better. edit: I just prompted chatGPT with this and pasted the result into the Typst editor. 20 compile errors. >Make a Typst doc with two columns per page and US page dimensions Same prompt but for Latex and pasted in overleaf. No probl…

I just tried the same prompt in chatGPT and it gave 10 errors. Mostly they were because it was using `#` as a comment character, which suggests that it has not been given very much typst code to examine.

Re: Typst 0.14

#156

Earlier quoted context omitted.

Maybe you have already checked these, but in case you haven't: - https://touying-typ.github.io/ Creating slides in Typst - https://cetz-package.github.io/ CeTZ is a package that allows for drawing with Typst with an API inspired by TikZ and Processing. It also provides plotting and chart libraries and is used in several other packages to create circuit, fretboard and more diagrams - maybe try getting your team to use…

These are great suggestions, but did I understand that suggest git as an alternative to overleaf? That's... not at all reasonable, as well as completely missing what problems overleaf solves for which people. Overleaf ist git und the hood. But what it really provides is Google Docs style collaboration on Latex documents. Reviewing the changes I review in Overleaf in GitHub pull requests would be incredibly painful an…

FWIW, there is an open-source collaborative editor for Typst that was posted a couple of weeks ago on HN: https://news.ycombinator.com/item?id=45481791

Re: Typst 0.14

#157
post #150
post #17

> Meanwhile, in HTML and SVG export, PDFs are converted to an embedded SVG on-the-fly. And, finally, in PNG export and the web app preview, PDFs are rasterized. All of this PDF processing functionality lives right in the Typst compiler, with no system dependencies. This is only possible thanks to the amazing work of community member @LaurenzV, who created a new PDF processing library called hayro from scratch. The li…

> is thus highly portable Much less portable than the C ecosystem though.

That’s simplistic. I maintain some large C and Rust programs, and I find Unix/windows issues much easier to fix on rust than in C, and supporting Linux and windows well matters a lot more than some obscure CPU Rust doesn’t support.

Re: Typst 0.14

#158
post #105

Earlier quoted context omitted.

This was a few months ago, but mainly Claude Sonnet 3.5 IIRC. 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…

It failed miserably with very simple requests. It was wrong but it wasn't clear if it was hallucinating or simply using old syntax. I did not try Claude though. Perhaps that performs better. edit: I just prompted chatGPT with this and pasted the result into the Typst editor. 20 compile errors. >Make a Typst doc with two columns per page and US page dimensions Same prompt but for Latex and pasted in overleaf. No probl…

I just tried the same prompt with Claude Sonnet 4.5. (Using a generic "programming" system prompt. It's a bit long, so I won't paste it here, but I can share it if you're interested.)

It generated this:

------------------

  #set page(
    paper: "us-letter",
    columns: 2,
  )

  #lorem(100)
This creates a Typst document with: - US Letter page size (8.5" × 11") - 2-column layout - Sample text (replace `#lorem(100)` with your actual content)

------------------

Which compiled to PDF without errors using Typst CLI v0.13.1. The two column layout is not visible with `lorem(100)`, but `lorem(1000)` shows it clearly.

I'm surprised you got 20 compile errors for what should be a very simple document.

So I would call this a success. I doubt Claude is that much better than ChatGPT (GPT-5?).

I'm not saying that this invalidates your experience, but I would suggest experimenting with different strategies and LLMs. Try some prompt variations, feeding it more (or less) context, higher-quality context, documentation, etc. These tools are highly sensitive and unreliable, but can be coerced into producing helpful results with some care and patience.

EDIT: I was curious, so I tried the same with ChatGPT-4o using OpenRouter's default system prompt. It produced this:

------------------

  // Set US letter page size
  #set page(width: 8.5in, height: 11in)
  
  // Create two-column layout using grid
  #layout(grid: (
    columns: 2,
    gutter: 0.5in, // space between columns
  ))
  
  // Example content
  = My Two-Column Document
  
  This is some text in the first paragraph. It will flow into two columns across the page.
  
  == Section One
  
  Here is more content that will automatically be distributed between the two columns. Typst handles the balancing and splitting of content across columns for you.
  
  == Section Two
  
  You can continue to add as much content as you'd like, and it will remain in the two-column format automatically.
------------------

This failed to compile because of a single error with `#layout`. Still, Typst errors are clear, and I could've probably fixed it easily myself by referencing the documentation.

Then I tried the same model with my custom generic programming system prompt, and it produced this:

------------------

  #set page(
    width: 8.5in,
    height: 11in,
    margin: 1in,
    columns: 2,
    column-gap: 0.5in,
  )
  
  = Title
  
  Here is some example text in the first paragraph. It will flow into two columns automatically.
  
  == Section
  
  More text continues here, and Typst will manage the column layout accordingly.
------------------

Which is better, but still failed to compile because `column-gap` is not a valid argument. Simply removing it compiled without errors.

I still would've consulted the official documentation to determine whether this is idiomatic code or not, but these are not terrible results. As with all LLMs, you'll get the most out of them if you use them as assistants, rather than vibe coding tools.

Re: Typst 0.14

#159

I write this in pretty much every Typst thread. Here are some notes I wrote when I started out with typst when comparing with LaTeX and some recent additions: 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 be…

> It's easier to version control and diff, especially if you use semantic line breaks

I don't get this one, it's equally easier to diff if you use semantic line breaks.

Re: Typst 0.14

#160

Earlier quoted context omitted.

Maybe you have already checked these, but in case you haven't: - https://touying-typ.github.io/ Creating slides in Typst - https://cetz-package.github.io/ CeTZ is a package that allows for drawing with Typst with an API inspired by TikZ and Processing. It also provides plotting and chart libraries and is used in several other packages to create circuit, fretboard and more diagrams - maybe try getting your team to use…

These are great suggestions, but did I understand that suggest git as an alternative to overleaf? That's... not at all reasonable, as well as completely missing what problems overleaf solves for which people. Overleaf ist git und the hood. But what it really provides is Google Docs style collaboration on Latex documents. Reviewing the changes I review in Overleaf in GitHub pull requests would be incredibly painful an…

In the Typst web app, you can link a project to a Git repository. This way you can have real-time collaboration in the web app, and versioning through Git. It's not the same as Overleaf's history GUI, but it's functional.
Post reply on HN