Live data from Hacker News

RaTeX: KaTeX-compatible LaTeX rendering engine in pure Rust

ratex.lites.dev

61–70 of 114 posts

Re: RaTeX: KaTeX-compatible LaTeX rendering engine in pure Rust

#62
post #51

I suppose somebody has to ask (and most likely complain) about this: what does RaTeX do for accessibility? I gather that it produces images. I checked the demo, and there's not even an alternative text or an ARIA label, so this seems completely invisible to anybody relying on a screen reader. This is quite a step backwards compared to modern LaTeX, which can now tag equations with MathML within the PDF, or using Math…

AFAIK, KaTex has accessibility via MathML included, but it doesn't provide an export as image - it rather renders as html. So why would you want the utility that you use to render an additional image to take care of something that KaTeX already does?

True, my knee jerk reaction came from seeing this run in the browser... but that does not change the question. RaTeX advertises itself as a renderer for native apps, but how are those apps supposed to implement accessible controls? Does RaTeX offer anything towards that?

Re: RaTeX: KaTeX-compatible LaTeX rendering engine in pure Rust

#63
When developing KeenWrite[1], I opted to support only plain TeX. This is because I wanted math typesetting to work for either LaTeX or ConTeXt[2]. To render TeX in the preview panel, I forked NTS[3] into a highly optimized Java version. The lack of cross-platform event-based UI system is what kept me from writing the entire application in Rust (some ten years ago). Has the Rust ecosystem improved with respect to Markdown processing, event-based UIs, and now TeX support?

[1]: https://keenwrite.com/screenshots.html

[2]: https://wiki.contextgarden.net

[3]: https://ctan.org/tex-archive/systems/nts

Re: RaTeX: KaTeX-compatible LaTeX rendering engine in pure Rust

#64
post #51

Earlier quoted context omitted.

AFAIK, KaTex has accessibility via MathML included, but it doesn't provide an export as image - it rather renders as html. So why would you want the utility that you use to render an additional image to take care of something that KaTeX already does?

True, my knee jerk reaction came from seeing this run in the browser... but that does not change the question. RaTeX advertises itself as a renderer for native apps, but how are those apps supposed to implement accessible controls? Does RaTeX offer anything towards that?

Honestly, I have no idea how native apps for desktop or mobile handle accessibility. There is katex-rs[0] that outputs html and mathML. I'd assume the two could work together and the mathML would be fed to whatever the screen reader receives instead of the image?

On a related note: is mathML more accessible than an AI generated text of how a human would read the mathematical or chemical formula?

[0] https://crates.io/crates/katex-rs

Re: RaTeX: KaTeX-compatible LaTeX rendering engine in pure Rust

#65

I am so confused. There's already a native version of LaTeX... it's... it's LaTeX. Why would a Rust implementation need to match KaTeX instead of properly implementing a real (and modern, so unicode-out-of-the-box) TeX engine, that LaTeX (which is a set of convenience macros) then trivially runs on top of?

Btw, the unicode-out-of-the-box version of LaTeX is called LuaLaTeX and ships with TeX Live.

Re: RaTeX: KaTeX-compatible LaTeX rendering engine in pure Rust

#66

I used LaTeX for approximately 10 years, for little things to relatively complex, including my bachelor’s and master’s theses. It never felt natural at reliable or consistent. Every customization required weird \makeatletter \makeatother hacks and was very brittle. Everything seemed more complicated than necessary and hard to grok, with weird interdependencies and interactions. There are probably good reasons for all…

as long as the arXiv doesn't accept Typst, it's never going to be a real alternative to LaTeX. and the arXiv maintainers seem either hostile or indifferent to Typst

https://www.youtube.com/watch?v=zNZlAbCOjd8

doesn't appear indifferent or hostile

Re: RaTeX: KaTeX-compatible LaTeX rendering engine in pure Rust

#67

Earlier quoted context omitted.

I took a look at the repo and it's probably the fault of the the SVG of the graphs, not of typist itself. Now, you could have used typst libraries to generate the graphs but back then (2 years ago I think?) it was probably a struggle.

Yea, I don’t see a point of criticizing minutiae from a thesis that has already been accepted, but I agree, the graphs look out of place and generally not in the same style of the other text. Also, I guess I am just really used to latex’s font, it just automatically gives an academic style that I do t get from this. Again, pure personal bias.

If anyone else is looking to make graph with typst, this can be done with https://cetz-package.github.io/ -- which is inspired by Tikz from the LaTeX world -- or https://lilaq.org/ which seems more appropriate for this type of data plotting

Re: RaTeX: KaTeX-compatible LaTeX rendering engine in pure Rust

#68

I used LaTeX for approximately 10 years, for little things to relatively complex, including my bachelor’s and master’s theses. It never felt natural at reliable or consistent. Every customization required weird \makeatletter \makeatother hacks and was very brittle. Everything seemed more complicated than necessary and hard to grok, with weird interdependencies and interactions. There are probably good reasons for all…

I like LaTeX for the most part (I have had to use some weird hacks but usually once they are done they are stuck in a macro and turned ignorable). But I think the main things it has going for it are that it: produces nice output, and all the journals accept it. Does there exist a tool that renders Typist to LaTeX? That could play nicely with the existing ecosystem.

Pandoc can convert LaTeX to Typst and back but probably only for simple snippets without any obscure packages. It’s not lossless.

Re: RaTeX: KaTeX-compatible LaTeX rendering engine in pure Rust

#69
post #64

Earlier quoted context omitted.

True, my knee jerk reaction came from seeing this run in the browser... but that does not change the question. RaTeX advertises itself as a renderer for native apps, but how are those apps supposed to implement accessible controls? Does RaTeX offer anything towards that?

Honestly, I have no idea how native apps for desktop or mobile handle accessibility. There is katex-rs[0] that outputs html and mathML. I'd assume the two could work together and the mathML would be fed to whatever the screen reader receives instead of the image? On a related note: is mathML more accessible than an AI generated text of how a human would read the mathematical or chemical formula? [0] https://crates.io…

> On a related note: is mathML more accessible than an AI generated text of how a human would read the mathematical or chemical formula?

Yes, screen readers would typically allow you to navigate the formulas in ways that are more sophisticated than text (not to mention the issues with translating to Braille, which I don't claim to understand, at all). In fact alternative text is a poor substitute for structured information about the formula, which is what you get with MathML.

Plus, the MathML + screen reader combo is deterministic and debuggable, as opposed to OCR'ing an image.

> There is katex-rs[0] that outputs html and mathML. I'd assume the two could work together and the mathML would be fed to whatever the screen reader receives instead of the image?

Maybe! You are parsing the input twice, but it could be a pragmatic solution. I don't know myself how native apps are supposed to expose MathML to screen readers (or if it is even possible without an embedded browser!).

Re: RaTeX: KaTeX-compatible LaTeX rendering engine in pure Rust

#70

I used LaTeX for approximately 10 years, for little things to relatively complex, including my bachelor’s and master’s theses. It never felt natural at reliable or consistent. Every customization required weird \makeatletter \makeatother hacks and was very brittle. Everything seemed more complicated than necessary and hard to grok, with weird interdependencies and interactions. There are probably good reasons for all…

Not a latex post with someone talking about typst. Come back when the html output works. Not having good accessible output was more acceptable back when Tex was invented, it definitely isn’t now, and they made a new system and somehow got this worse then modern latex.

Typst does have have accessibility features.[1]

I don't worry too much about HTML output still being WIP. Even if TeX had a massive head start, Typst has a good development speed, and a little bit of slope makes up for a lot of y-intercept.

[1]: https://typst.app/docs/guides/accessibility/

Post reply on HN