Live data from Hacker News

Exploring Typst, a new typesetting system similar to LaTeX

blog.jreyesr.com

211–220 of 243 posts

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

#211

Earlier quoted context omitted.

I really hope so, and I will start recommending typst when there is good accessible output. However, it’s also been a “top priority” since basically the first release.

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.

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

#213
post #29

In the very limited time I used typst it has been pretty amazing, but imho there is one missing feature that a LaTeX successor, but even more so, templating engine should have. Come up or adapt a format, that can defer certain styling decisions to the consumer of the document. Stuff like, font, font size, line spacing, citation style, double or single column, numeration style, etc. On a different note, we got to find…

> Come up or adapt a format, that can defer certain styling decisions to the consumer of the document. Stuff like, font, font size, line spacing, citation style, double or single column, numeration style, etc. We have that, it's called HTML. The use case is quite different from PDF though.

Paged.js might scratch that HTML-as-a-doc itch until we can drop the polyfill for the actual CSS paged media spec [0].

[0]: https://github.com/pagedjs/pagedjs/tree/main/examples

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

#214

What is the story with the fonts Typst uses? Does it come with a standard library of fonts? I am not a fan of LaTex myself, but I admire it to some extent. Other systems come along that are less verbose and easier to write, and faster. Yay. And then people use it, and then someone thinks "oh we should have this function", "We need to add a feature for it to work well" etc etc and slowly the system either bloats, and…

Adding a font is just `#set text(font: "besley")` or you can use a list for fallback like `#set text(font: ("jost", "noto sans")`. Then you can select weight, italic/bold, opentype features, ligatures, etc. as options on `text` with the same syntax.

You can see all the options for `text` here: https://typst.app/docs/reference/text/text It will likely need some reorganization in time, but is quite functional.

The command line comes with a few defaults such as the open source Libertinus for text or New CMM for math, but may fall back to your System fonts for characters like emoji (and there are flags to disable system fonts). You can also set a specific path to look up font files.

And then the web app has plenty of fonts in an extensive dropdown, and supports dropping in custom font files that will be automatically recognized.

I believe one current limitation is bitmap fonts not working properly, but that is being actively developed by a contributor.

I'm optimistic that Typst won't run into the issues you mention. I see it as doing well at incorporating the knowledge of the past into simpler, better interfaces.

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

#215

I really want to like this because it seems a lot more accessible to folks than latex but I'm getting that "uncanny valley" feeling like when I look at equations that have been typeset in MS Word. They look almost, but not quite, good. Like if you look at the equation for Binet's closed form solution for Fibonacci numbers in the link below from their github, it looks to me like there is a bit too much space on either…

I think you're imagining things... This spacing stuff is mostly defined in the font files and typst uses the same math font (or a more recent version, depending on your LaTeX config). I made a small comparison: https://imgur.com/a/0k6dsok Note that by default, typst uses the book weight from New Computer Modern. This corresponds to the default settings in LaTeX with the "fontsetup" package. The only difference I can…

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.

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

#216
post #215

Earlier quoted context omitted.

I think you're imagining things... This spacing stuff is mostly defined in the font files and typst uses the same math font (or a more recent version, depending on your LaTeX config). I made a small comparison: https://imgur.com/a/0k6dsok Note that by default, typst uses the book weight from New Computer Modern. This corresponds to the default settings in LaTeX with the "fontsetup" package. The only difference I can…

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 think the size difference was just me being careless with zoom levels in different apps. I thought it was enough to make the point, since you can compare the space sizes to the character sizes. I put another comparison here: https://imgur.com/a/aZRx6fs , this time with same font size and zoom level.

Anyway I agree that looking exactly the same as Latex is not particularly desirable, but it helps for convincing Latex users to switch.

(The screenshots were made on Linux, with scaling but not fractional I think... But I can't check right now)

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

#217
post #196

Earlier quoted context omitted.

Embedding words like Figure or Section breaks not only declensions, but capitalization, too. Germans won't notice it because all their nouns are capitalized, and English speakers won't care because they're traditionally forgiving with unmotivated upper-case words in the middle of a sentence (including titles). But formally it shoud be "Figure 4" in the caption and "as we see in figure 4" in the reference.

"as we see in figure 4" is simply incorrect, though; expressions such as "Figure 4" or "3rd Street" are treated as proper names and must be capitalised, as would the non-nominal "third" in "Dritte Straße" if any German-speaking city were to have American-style numbered streets.

Those two cases seem completely distinct: do you have a source for the claim that labeling stuff in documents with type and number makes those labels proper names?

For addresses, that's usually listen in a language grammar as a rule.

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

#218

Earlier quoted context omitted.

I'm curious, how does typst work out that I want the function expanded or I want the literal string if there's no marker.

There are 3 syntactic modes in typst: markup, code and math. In markup, everything is literal, unless you put a `#` sigil like `#expr` in which case `expr` is parsed in code mode. In code mode everything is an identifier, as usual in programming. In math its a bit of an ugly tradeoff but its ok: single-letter things are parsed as literals but multi-letter tokens are parsed as identifiers. Finally, in code you can enc…

I think I would have preferred a consistent sigil, but I guess with fast enough feedback you'd get used to the quirks.

I do wonder if this has over-optimised on short equations—to me heavy maths use implies multi-page equations with very specific formatting requirements (something amsmath has no issues with, which isn't surprising given who the authors are).

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

#219
post #29

In the very limited time I used typst it has been pretty amazing, but imho there is one missing feature that a LaTeX successor, but even more so, templating engine should have. Come up or adapt a format, that can defer certain styling decisions to the consumer of the document. Stuff like, font, font size, line spacing, citation style, double or single column, numeration style, etc. On a different note, we got to find…

You can do that in a couple different ways in Typst. First, if the user passes content into the template, then it's the user's content that ultimately gets to choose its styling. That is, there are three places that a style can be set: 1. In the content passed that the user passes to the template 2. In the template itself 3. By the user, outside the template They take priority in that order. OTOH, if the template rea…

I think they were saying they want a format instead of PDF where the reader can change those things.

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

#220

Earlier quoted context omitted.

With your experience of both, have you found that Typst has fewer issues with conflicting/non-commutative plugins than LaTeX does? Because that's where I lose the most time with LaTeX: packages often mess with the (piles of) global state in ways that sometimes conflict, and the only "solution" seems to be that, if you're very lucky, sometimes conscientious package authors will try to "detect" (through various hacks)…

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 to have no effect.

Based on your explanation of Typst having a global namespace, I would expect such conventions (like a function A that by convention calls a function B, both of which can be redefined by any package) to arise in Typst just as they have done in LaTeX. (This risk would be much reduced if Typst didn't have functions as first-class values, but from the TFA, I see that it does.)

>Compare to LaTeX where sensible code is broken when a package makes a small changes somewhere deep in the macro pile of cards.

LaTeX has grown "a macro pile of cards" because (a) the base LaTeX system was not comprehensive/expressive enough to let users express everything they wanted to do "within the system" (i.e., by merely twiddling existing knobs in a composable way) and (b) because it is possible (indeed, relatively straightforward, at least initially) to make them.

Maybe Typst has a much more comprehensive and well-designed set of knobs, in which case the conditions will not arise that encourage the same "macro pile of cards" to form. Otherwise, I don't see any reason to expect that it will wind up any different.

Post reply on HN