Live data from Hacker News

Exploring Typst, a new typesetting system similar to LaTeX

blog.jreyesr.com

51–60 of 243 posts

Re: Exploring Typst, a new typesetting system similar to LaTeX

#51
The two baseline criteria I have for better-than-LaTeX options are:

1. Maths support equal to or better than amsmath 2. LaTeX-style macros

Both are needed to make writing large amounts of complex equations acceptable.

There should also be something similar to unicode-math, cleveref and biblatex, easy-to-use options to control layout/style/output (including metadata).

Re: Exploring Typst, a new typesetting system similar to LaTeX

#53

I was hoping that the syntax for equations would be borrowed from LaTeX but it is not the case unfortunately. I would like to switch away from LaTeX, but i think the syntax for equations in LaTeX is pretty sensible actually.

Have you tried with ConTeXt? As LaTeX, it's built atop TeX - though it's not as modular (and popular) it's more powerful. I'd like to like Typst, but (as mentioned the other day) it follows the same model as LaTeX - great for some predefined styles, but the moment you want or need something different you'd need to get third party plugins, and with that all the perks and cons they may have.

> Have you tried with ConTeXt?

Have you taken a look at my text editor, KeenWrite?

https://keenwrite.com/screenshots.html

The text processing chain for KeenWrite is:

    Markdown (input) -> XHTML (export) -> ConTeXt (import) -> PDF (output)
The look and feel of the final PDF document is controlled by a theme, which allows complete customization.

Re: Exploring Typst, a new typesetting system similar to LaTeX

#54

The two baseline criteria I have for better-than-LaTeX options are: 1. Maths support equal to or better than amsmath 2. LaTeX-style macros Both are needed to make writing large amounts of complex equations acceptable. There should also be something similar to unicode-math, cleveref and biblatex, easy-to-use options to control layout/style/output (including metadata).

I wrote a recent paper in typst. We ended up converting it to latex at the last minute to work with the conference’s submission guidelines, and work around a small bug (now fixed) in typst. But I would 100% use typst again. I wish it output html so I could use it for blogs & documentation.

The maths support was more than good enough for what we needed, and I enjoyed writing it a lot more than latex maths. The macro-equivalent support in typst is fantastic. It’s a standout feature. It has a full, modern-feeling programming language built in, complete with modules, functions, variables, arrays, the whole works. And there’s a growing ecosystem of 3rd party packages you can use with typst. Our benchmark scripts output the results into json files. Then when the typst document compiled, our typst source pulled in the benchmarking data directly from those json files. Then it used that data to populate tables and render charts directly, straight into the pdf. It was a lovely way to work.

(Though that said, I ended up swapping to a more fully featured external charting library because the charts it created looked better).

Re: Exploring Typst, a new typesetting system similar to LaTeX

#55

I've been looking into it. It's `blazingly fast` (aside from the rust joke, it really is way faster than latex), the syntax is more "modern", consistent, etc. The main problem is the popularity. It just does not have enough packages, at least for my use case. I mainly do a lot of equations (simple math), and a loooot of tikz (forest, circuitikz, pgfplots, etc.) [ https://gitlab.com/vslavkin/escuela/-/tree/main/5to?re…

> Besides the typst packages, it also lacks the editor packages. I am an emacs user…

The typst editor plugin for vscode is pretty great. It gives you a split view of source & pdf, and you can cmd+click on either side to scroll to the corresponding source / rendered output. It also does things like give you autocomplete on fields from externally referenced json data.

Obviously, that might be no help if you’re married to eMacs. But if you’re a little promiscuous with editors like I am, give it a try.

Re: Exploring Typst, a new typesetting system similar to LaTeX

#57
post #45
post #41

Earlier quoted context omitted.

The key difference between print systems and web tech is responsiveness. Anything print related is primarily designed with dead tree format in mind, so the layout won't change, and you don't have to worry about text reflowing after editing. It's also why LaTeX/PDF to HTML converters are so difficult to build, because the underlying engine has no semantic information about the structure (this may be changing with LLMs…

> The key difference between print systems and web tech is responsiveness. True, but... we were very good at building unresponsive websites in the early 2000s. Can't we just return to tradition and disable a lot of the responsive behaviour that we've layered onto HTML with an off-the-shelf stylesheet? Hardcode some width properties, ya know? (This is not a rhetorical question, genuinely curious).

Then you might as well just use PDF.js and render the PDF in its entirety.

Re: Exploring Typst, a new typesetting system similar to LaTeX

#58
post #14

Earlier quoted context omitted.

> The selling point seems to be that this is more similar to Markdown. The problem is that extending Markdown syntax gets messy. #figure( image("image.jpg", width: 70%), caption: [ Observe the image in the picture ], ) This is kind of a strange blend of Markdown, CSS, JSON, and HTML. TeX at least has a consistent syntax.

Was do you find inconsistent here? It seems pretty consistent to me, except maybe the

and that tag is kind of moot -- as another commenter mentioned, it could have been some other html tag like a div

Re: Exploring Typst, a new typesetting system similar to LaTeX

#59
post #14

Earlier quoted context omitted.

> The selling point seems to be that this is more similar to Markdown. The problem is that extending Markdown syntax gets messy. #figure( image("image.jpg", width: 70%), caption: [ Observe the image in the picture ], ) This is kind of a strange blend of Markdown, CSS, JSON, and HTML. TeX at least has a consistent syntax.

These 6 lines actually put me off. Probably I have to read more about Typst syntax but, same for me, consistent syntax which covers necessary complexity wins over bending a markup language for purposes for which it was never intended.

It’s best not to think of it as a markup language. It’s a programming language designed around the needs of outputting pdfs.

Structurally it’s like a modern, nice version of php, only it’s built for academic articles rather than emitting websites.

The code snippet there packs in about 8 typst concepts all at once. It’s like if someone showed off how “simple” c++ is by showing some template-heavy magic. It’s straightforward once you’ve spent time with the language, but it’s a pretty terrible place to start learning typst. (That example shows expression mode, block mode, function calling, tags, named arguments, and probably more. Whew!)

Re: Exploring Typst, a new typesetting system similar to LaTeX

#60
post #13

This is neat. I've used Latex before, and it definitely suffers from poor ergonomics. Both the language and tooling contribute to this. The selling point seems to be that this is more similar to Markdown. That makes sense, Markdown is objectively more common and has more users than Latex. I've used both, but Markdown way more often. Here's something I don't understand: it would be trivial to make Typst even more simi…

Places I’ve switched from LaTeX to Typst: My resume, research papers. Markdown was never a serious contender for my resume, since I want to control the rendering and the layout. Places I’ve switched from Markdown to Typst: Slides. There are some okay Markdown-to-HTML solutions, but they have this unfortunate side-effect that you move the slides to some other computer, and something breaks in your rendering. PDFs ftw.

I really wish typst had a good way to emit html. Id love to use it for blogging & technical writing and documentation.
Post reply on HN