Live data from Hacker News

Typst: A Programmable Markup Language for Typesetting [pdf]

user.tu-berlin.de

21–30 of 55 posts

Re: Typst: A Programmable Markup Language for Typesetting [pdf]

#21

I really like the paper, though I'm not sure the world needs another Turing-complete document language however well-motivated ;) As SGML pedant however, I can't resist commenting on the following: > The second offspring of SGML is XML, specified by the World Wide Web Consortium (W3C) in 1998. It has a reduced feature set compared to SGML (for example, it forbids unclosed tags and concurrent markup). But it retains th…

But HTML never was “an SGML application” in practice, and I highly doubt it was ever actually envisioned as that. There may have been some tools out there that processed HTML as SGML, but none of the ones I know of did (most notably browsers).

And in fact, in practice you could just use your own custom elements without worrying about validity and it’d mostly just work. This wasn’t even particularly rare. (There was the whole “CSS doesn’t work on them until you call document.createElement("…")” bug in IE, but that’s the only problem I can think of, and it was easily worked around.)

Re: Typst: A Programmable Markup Language for Typesetting [pdf]

#22

I really like the paper, though I'm not sure the world needs another Turing-complete document language however well-motivated ;) As SGML pedant however, I can't resist commenting on the following: > The second offspring of SGML is XML, specified by the World Wide Web Consortium (W3C) in 1998. It has a reduced feature set compared to SGML (for example, it forbids unclosed tags and concurrent markup). But it retains th…

But HTML never was “an SGML application” in practice, and I highly doubt it was ever actually envisioned as that. There may have been some tools out there that processed HTML as SGML, but none of the ones I know of did (most notably browsers). And in fact, in practice you could just use your own custom elements without worrying about validity and it’d mostly just work. This wasn’t even particularly rare. (There was t…

HTML the markup language was clearly intended as an SGML vocabulary - TBL himself said as much [1] and HTML also reused element names from the SGML spec/handbook as example/folklore vocabulary such as for paragraphs and headings.

What browsers made out of it isn't the matter here, but even if it were, the "practical, real-world HTML out there" argument is mostly used to pull up the ladder by an ad company/browser cartel made worse day-in day-out through an atrocious and absurdly voluminous HTML spec (and by CSS, of course).

Even though Ian Hickson, of WHATWG, wanted to capture HTML as it was understood by browsers, he couldn't help but added additional elements of his own - such as for marking up ads as "aside" lol plus the alien sectioning elements concept that gave rise to the flawed "outline algorithm" and misuse of heading elements (and earlier failure to understand SGML's RANK feature), a problem that was only fixed last year [2] by an incompatible change to HTML invalidating documents using hgroup as originally advised.

In practice, very few changes to the HTML syntax brought HTML outside SGML - for the most part, ad-hoc and basically unnecessary commenting rules for the script and style elements to keep legacy browsers from rendering JavaScript and CSS, resp., when those where introduced.

[1]: http://info.cern.ch/hypertext/WWW/MarkUp/MarkUp.html

[2]: https://github.com/w3c/htmlwg/issues/22

Re: Typst: A Programmable Markup Language for Typesetting [pdf]

#24

As far as I can tell it compiles directly to pdf, which seems a non-starter for submitting to many journals which accept either latex or word documents. This would need various compiler backends (perhaps via pandoc) to be that useful. Certainly it would help adoption if you could emit, eg., markdown/latex/etc. and others you're working with wouldn't need to adopt your tooling.

Markdown is not close to powerful enough to produce all the stuff that Typst can produce, and emitting latex would be a massive technical effort. I think the best hope is that whatever journals currently only accept latex or .docx will start accepting typst files (or at least pdf).

One has to bow first and I do not think that journals and large publishers will be the ones. A typst LaTeX converter would be something which would be a huge feature I'd pay for. I am writing papers for journals/publishers after all.

Re: Typst: A Programmable Markup Language for Typesetting [pdf]

#25

Note for the authors: I have just taken a look to the syntax. It is pretty close to djot [1]. Of course Typst is more powerful than djot. One noticeable difference is the chosen markup for headers (`=` instead of `#`). This could be nice to reduce differences and make Typst a close-to superset of djot. [1] https://www.djot.net

We have switched back and forth on this because we also wanted to stay as close to Markdown as possible, just for the familiarity. However, the fact that Typst also uses the hashtag to indicate an inline expression led to too much confusion (`#thing` was a variable access and `# thing` a heading). And the hashtag is really quite nice for these inline expressions, so it won over the headings. Using `=` for them does h…

Definitely a lot of precedent for `=` for headers:

https://pldb.com/languages/asciidoc.html

https://pldb.com/languages/creole.html

https://pldb.com/languages/texti.html

https://pldb.com/languages/mediawiki.html

Re: Typst: A Programmable Markup Language for Typesetting [pdf]

#26

I've been working on something somewhat similar for producing legal documents, called Linked Markdown ( https://linked.md ). So the section about modules/importing and dynamic references really rang a bell. Very cool stuff, will keep track of progress.

I'm very interested in computational law. Drop me an email if you ever want to chat.

Re: Typst: A Programmable Markup Language for Typesetting [pdf]

#28
This is exciting, as I've been waiting for something like this to come along as I'm typesetting an RPG book with LaTeX, and they generally have rather complex layouts:

Random example:

https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2F...

Calculating stat-blocks by hand is a nighmtare for one author, so I need a typesetting language so I can type `\elf`, and have a random elf, then generate all its derived stats correctly (like Attack, Defence, et c.).

My example: https://i.redd.it/ng82unzqxru41.png

Each book has different versions (minimal/ full) so getting reliable output has been a bit of a chore.

LaTeX is the only tool I know which can do the job, but it's still a bit of a nightmare at time. Ugly formatting means my code looks whacky, images can't float cleanly around a multicolumn environment, packages conflict, words overlap and it needs constant hand-holding.

Typst looks like just what I've been after - something like rmarkdown, with more power. Tables and layouts, and best of all - no packages.

What licence is typst under?

Will it be able to reference page numbers from a different book dynamically? (so if book-a and book-b are in the same directory, one can reference another's sections)

Will there be support for intelligent floating images?

Will it accept 'every-page' commands, so I can use that #rect command to show a chapter's name on side-tabs?

Will error messages tell me hbox underfull badness 10000 at least 3000 times per compile?

Re: Typst: A Programmable Markup Language for Typesetting [pdf]

#29
post #24

Earlier quoted context omitted.

Markdown is not close to powerful enough to produce all the stuff that Typst can produce, and emitting latex would be a massive technical effort. I think the best hope is that whatever journals currently only accept latex or .docx will start accepting typst files (or at least pdf).

One has to bow first and I do not think that journals and large publishers will be the ones. A typst LaTeX converter would be something which would be a huge feature I'd pay for. I am writing papers for journals/publishers after all.

My initial hope was that this would be a front-end for latex.

Re: Typst: A Programmable Markup Language for Typesetting [pdf]

#30
post #24

Earlier quoted context omitted.

One has to bow first and I do not think that journals and large publishers will be the ones. A typst LaTeX converter would be something which would be a huge feature I'd pay for. I am writing papers for journals/publishers after all.

My initial hope was that this would be a front-end for latex.

check out MonsterWriter
Post reply on HN