Live data from Hacker News

Exploring Typst, a new typesetting system similar to LaTeX

blog.jreyesr.com

231–240 of 243 posts

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

#231
post #215

Earlier quoted context omitted.

You have a Mac with fractional scaling, your screenshots show the common blurriness render issue more than anything else I believe. Apart from that there is clearly a size difference but I agree that it's quite close. I think it's good to be detailed oriented but I'm not sure the fetish around Latex rendering is warranted.

I agree with you entirely fwliw. For me it's not a fetish particularly, the spacing just looks too wide in that one case and the comparisons if anything confirm that. "Too wide" is of course entirely a matter of personal opinion but I can't see myself switching to something I don't prefer the output of. I may well change my mind in future and I'm probably going to give typst a go at some point, because looking at the…

[deleted]

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

#232
Latex already has massive amounts of libraries. Simple things like chemistry or physics typesetting for example. That's hard to just switch away from. can it do freetype fonts? I use XeLatex to change the fonts since the default gets boring. I've been doing all my math in latex for so long I feel like I can't just switch to something else.

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

#233
post #221
post #81

Earlier quoted context omitted.

Yes at https://github.com/rikhuijzer/phd-thesis

Great thesis on an interesting topic. I’m always a fan of good model explainability. What did you use to generate the attractive and clear svgs?

Thank you for the kind words.

The plots were all created with Makie.jl [1] and lots of fiddling and manually writing code to get things right. Although I think Makie is great, I guess it would also be possible with other plotting libraries.

[1]: https://docs.makie.org/stable/

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

#234
post #82

References in established systems like LaTeX work the way they do for a reason: you don't want to embed words in them (like "Figure" or "Section") automatically because it does not work across languages. Eg. both the article and docs at https://typst.app/docs/reference/model/ref/ use an inline reference that wouldn't work in Serbian. Serbian (and many other languages) have suffix declensions, so while "Figure 4" is "…

Surely it could just insert the proper form depending on context? (with language-specific code of course)

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

#235

Earlier quoted context omitted.

I think compatibility issues in LaTeX often come from packages that redefine the same macros in incompatible ways. This kind of things doesn't happen in typst because all user code is pure: a package can define 1) values or pure functions that can be imported (this makes them available only in the scope where they're imported) and 2) content that can be included in the document. There's still potential for conflicts,…

Thanks for the detailed response. >compatibility issues in LaTeX often come from packages that redefine the same macros in incompatible ways Absolutely. A related but more subtle problem occurs when macro A ordinarily calls a macro B, but a package redefines A not to call B at all (perhaps reimplementing part of B itself), and then, when the user includes a second package that redefines B, this latter package appears…

The global namespace in typst is limited to "states", a rather specific feature similar to the global TeX counters for headings and equations. So it's possible for two packages to increment the same counter. Everything else is local. All functions and variable definitions are local, and every function is pure: a function call cannot have any side effect. In particular, a package cannot redefine a function.

(You may wonder how functions can be pure if they can increment counters.... The way it works is that you call the function and put the return value in the stream of content of the document. And this value can be something that says "increase counter X by Y". And when you read the counter, typst applies all such "counter instructions" that are in the document so far, and gives you the result.)

The special knobs that typst provides are the "set" and "show" rules. With "set" rules you can change the default values of elements created later in the same scope. For example "#set text(fill: red)" will make it so that all text created later in the same block of code without a specified color will be red. With "show" rules you can define transformations that will be applied to elements created later in the same scope. For example "#show math.equation: it => figure(it, caption: "An equation")" will wrap every equation in a figure with the given caption.

I think the main reason LaTeX is a pile of cards is because TeX is terrible as a general purpose programming language. Just an example: the fact that a macro called with particular arguments will behave differently depending on the current state of catcodes is a craziness that's hard to imagine when you think in terms of "normal" programming. And the whole ecosystem of amazing packages that make LaTeX so useful, they need to do the kind of things you'd normally do in a normal programming language, so these packages end up working around the oddities of TeX in ways that make the whole thing a pile of cards.

With its design based on pure functions, I'd say typst is at the other end of the spectrum in terms of how easy it is to write code that works reliably without interference from other people's code.

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

#236
post #234
post #82

References in established systems like LaTeX work the way they do for a reason: you don't want to embed words in them (like "Figure" or "Section") automatically because it does not work across languages. Eg. both the article and docs at https://typst.app/docs/reference/model/ref/ use an inline reference that wouldn't work in Serbian. Serbian (and many other languages) have suffix declensions, so while "Figure 4" is "…

Surely it could just insert the proper form depending on context? (with language-specific code of course)

That's what ChatGPT sometimes struggles to do correctly for Serbia : the rules are tricky and depend on the surrounding text. Eg. if you want to say "In figures 4 and 5", you are already struggling (even in English).

So even embedding latest LLM won't solve it so it's better to leave it to the author to do the right thing.

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

#237

Earlier quoted context omitted.

The issue is a bit more than a year old. Feel free to step up and close it. Complaining about it isn't going to add velocity to a new project.

Adding accessibility to every open source project which neglected it would take a team of thousands. I work on accessibility on the open source programs I already contribute to.

PDFs can be translated to EPUB using existing programs. I'm going to go out on a limb and guess that Typst emits "good" PDF (I worked on a PDF program for years and I know it when I see it) so that conversion should be fairly high fidelity.

Clearly this is not as good as offering a second backend, but the latter is also a huge amount of work. I'm sure if you showed Typst cases where their PDF output doesn't translate to EPUB cleanly using available converters, they would at least investigate and see if they can improve that.

But without demonstrating that translation isn't working, I'm not going to accept the claim that there's an accessibility problem here.

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

#238

Earlier quoted context omitted.

So your books are like these? https://store.metasnake.com/effective-pandas-book Jupyter-to-PDF sounds like a perfect match here!

Yes. I've gone from rST to epub/LaTeX, to markdown to epub/LaTeX (via Pandoc), to Jupyter (with markdown) to epub/Typst.

Tried Quarto? It works with Typst as well.

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

#239

In the near future, I'll have to program the document generation part of an invoicing system. In the past, I've done generated PDF documents through latex, and didn't really like the process (for one, escaping is just so weird in latex, \ to \textbackslash for example). I've thought about generating HTML and using a headless browser that can produce PDFs for me, but I don't know how well you can e.g. control page bre…

I think css is fine at doing page breaks. https://developer.mozilla.org/en-US/docs/Web/CSS/break-befor...

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

#240

Earlier quoted context omitted.

Adding accessibility to every open source project which neglected it would take a team of thousands. I work on accessibility on the open source programs I already contribute to.

PDFs can be translated to EPUB using existing programs. I'm going to go out on a limb and guess that Typst emits "good" PDF (I worked on a PDF program for years and I know it when I see it) so that conversion should be fairly high fidelity. Clearly this is not as good as offering a second backend, but the latter is also a huge amount of work. I'm sure if you showed Typst cases where their PDF output doesn't translate…

I downloaded the first typist pdf I could find:

https://github.com/Leedehai/typst-physics/blob/master/physic...

And fed it through the top pdf2epub on google:

https://cloudconvert.com/pdf-to-epub

Plain text is fine, but all maths is mangled, and tables and matrices are completely destroyed.

Post reply on HN