Live data from Hacker News

RaTeX: KaTeX-compatible LaTeX rendering engine in pure Rust

ratex.lites.dev

101–110 of 114 posts

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

#101
post #26

Earlier quoted context omitted.

I’ve been using Typst for years now. Wrote my PhD thesis in it [1] as well as a book. Works great; can’t recommend it enough. I usually barely use plugins because it’s either already included or pretty easy to write a bit of code yourself [1]: https://github.com/rikhuijzer/phd-thesis

Didn't see a pdf of your thesis, except on your web-site[1]. But the version there (at least as it renders on my machine), has numerous formatting issues. For one egregious example, look at the letter spacing in the title and legend of Figure 2.2 (page 27): "civilia ns", "Pe rs ona lity s core". I'm sure the content is great, but using it as an example of Typst prowess, seems ill-advised. [1] https://huijzer.xyz/file…

> look at the letter spacing in the title and legend of Figure 2.2 (page 27): "civilia ns", "Pe rs ona lity s core"

The legend and title were generated by Gadfly.jl.

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

#102
Despite the "Gold-suite" comparison, when looking at the KaTeX and RaTeX output [1], the KaTeX output is consistently better. RaTeX has either a lot of aliasing going on or appears blurry.

But the native and library nature of RaTeX is very interesting, especially with the provided C ABI.

[1] https://ratex.lites.dev/demo/support-table

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

#103
post #95

Earlier quoted context omitted.

I still find it easier to align tables with numbers in TeX on the decimal point than in anything else. How is this even achieved with HTML or Word? Eg. variable width numbers like 4.53 13.98765 7 -1,000,234.76 Not perfect in TeX either, but at least possible.

The irony of your comment...

If you are not referring to the use of exaggerated examples to more clearly show the point, I wonder what do you refer to?

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

#104

Earlier quoted context omitted.

It's kinda fascinating how dominant LaTeX is, how nice its output is, how respected Knuth is as a computer scientist, and at the same time how totally awful it feels to use it. Hard to figure out how it can be so good and so bad at once. Posts/discussion I found interesting: - http://www.goodmath.org/blog/2008/01/10/the-genius-of-donald... - https://tex.stackexchange.com/q/24671 - https://news.ycombinator.com/item?id…

part of the challenge is the inherent irreducible complexity of the domain. "Make text look good on page" leaves lots of details unspecified. another part is many people built their own solution to their own corner of this domain, and not all of them had the deep appreciation for how the rest of the TeX system works. I hear similar complaints about "Make web page look good", which is popular but also a huge mess of a…

> "Make text look good on page" leaves lots of details unspecified.

Even just a sane layout renderer is incredibly hard. A decade ago I wrote a bespoke DNA sequence typesetter (in svg) and I had claude build an extension, for whatever reason it chose to build it from scratch instead of using the components I had built, and it did everything wrong.

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

#105
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?

I'm working on a Neovim plugin to render LaTeX in Markdown, and I'm struggling with this. Why is it so hard to simply render an image from KaTeX?

What are you struggling with? If you want an image output, there a reason you want to use KaTeX for this, and can't just use actual LaTeX?

KaTeX depends on the browser engine to do most of the layout, so generating an image would require a tool which converts the HTML nodes back into an image. There are some tools that can do that (like html2canvas), but using LaTeX to generate a PDF and then converting that to an image is probably going to be easier.

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

#106

Despite the "Gold-suite" comparison, when looking at the KaTeX and RaTeX output [1], the KaTeX output is consistently better. RaTeX has either a lot of aliasing going on or appears blurry. But the native and library nature of RaTeX is very interesting, especially with the provided C ABI. [1] https://ratex.lites.dev/demo/support-table

Are you viewing on a HiDPI monitor? I imagine this is mostly because RaTeX renders to an image whereas KaTeX is rendering HTML, so can scale to arbitrary dpi. I imagine the RaTeX people could have rendered to a higher resolution and it would look better.

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

#107
post #95

Earlier quoted context omitted.

I agree that tables are not great, but figures? Seems to work pretty well, better than word for sure.

I still find it easier to align tables with numbers in TeX on the decimal point than in anything else. How is this even achieved with HTML or Word? Eg. variable width numbers like 4.53 13.98765 7 -1,000,234.76 Not perfect in TeX either, but at least possible.

In Word you add a decimal tab stop to the ruler. Word's main problem is that people are unaware of its features; they don't spend time learning it like they do with TeX.

https://imgur.com/jipZ90B

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

#108
post #75

Earlier quoted context omitted.

Not necessarily my experience. I wrote (and I am writing) several academic documents with it. There are its quirks, of course, but with good classes such as memoir, I don't feel the need to do a lot more than basic customization in the preamble. Still is a good tool for me.

For me the memoir class made LaTeX worse. The titlesec package is more customizable, easier to use, and reduced the size of the preamble significantly.

That's if you need to customize headings. I usually can keep using the standard ones, so that's not my case, and I suspect this also applies to a lot of people.

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

#109

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…

Meh. For cross-platform, low hassle, just use LyX + XeTeX + decent fonts. Once you learn how to do the commonly annoying things (alignment; indices; pages without footers; custom footers; etc. - AI is good), you can achieve all of them. You will positively loathe using conventional word processing after a short while. https://www.lyx.org/

Oh, wow, there's a new LyX release! It's been almost 30 years since I used it and it's still going.

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

#110

Earlier quoted context omitted.

This mirrors my experience. It's worth noting that TeX was developed in the same time period that the details of lexical scope were being nailed down by Guy Steele in the Rabbit compiler for Scheme. It's not that TeX is an ad hoc system; it's more the case that people didn't actually know how to implement a better system at the time.

The details of lexical scope where defined in Algol 60 (1960), nearly 2 decades before Rabbit (1978). People did know how to implement things back then, and TeX is a great example of that. It is just our definitions have changed over the years of what we consider better.

Rabbit was closure conversion, which was efficient implementation of first-class functions with lexical scope. The abstract discusses the difference with ALGOL:

https://dspace.mit.edu/handle/1721.1/6913

Post reply on HN