Live data from Hacker News

Problems with math rendering on the web (2020)

danilafe.com

1–10 of 87 posts

Re: Problems with math rendering on the web (2020)

#3
KaTeX supports server-side Node rendering pretty easily. https://katex.org/docs/node.html Maybe MathJax does too, but I haven't checked.

I use this on https://vcvrack.com/manual/DSP to parse $inline$ and $$block$$ TeX into MathML with a couple lines of server-side code (simplified for readability):

    html = require('markdown-it')({html: true, linkify: true, typographer: true})
        .use(require('markdown-it-texmath'), {engine: 'katex', delimiters: 'dollars'})
        .render(body)

Re: Problems with math rendering on the web (2020)

#4
I implemented a TeX engine in WebAssembly so you really can run TeX in the browser. You can see a demo of this at https://tex.rossprogram.org/ and at https://github.com/kisonecat/web2js you can find a Pascal compiler that targets WebAssembly which can compile Knuth's TeX. Interesting primitives like \directjs are also implemented, so you can execute javascript from inside TeX. The rendering is handled with https://github.com/kisonecat/dvi2html for which I finally fixed some font problems.

To make it relatively fast, the TeX engine gets snapshotted and shipped to the browser with much of TeXlive already loaded. So even things like TikZ work reasonably well. There is of course a lot more to do! The plan is to convert ximera.osu.edu to this new backend by the fall.

Re: Problems with math rendering on the web (2020)

#5

I implemented a TeX engine in WebAssembly so you really can run TeX in the browser. You can see a demo of this at https://tex.rossprogram.org/ and at https://github.com/kisonecat/web2js you can find a Pascal compiler that targets WebAssembly which can compile Knuth's TeX. Interesting primitives like \directjs are also implemented, so you can execute javascript from inside TeX. The rendering is handled with https://gi…

This is wonderful!

I'm a wasm neophyte -- even the set up seems complex to me. Do you have any recommendations for where to dive in?

Re: Problems with math rendering on the web (2020)

#6
post #2

Eh. Every client already renders all the HTML into visual format. I don't see what's wrong with rendering the LaTeX too. Sure it would be nice of browsers could render the LaTeX natively instead of using JS.

given the origin of the web at cern, it's actually surprising that it didn't include LaTeX from day 1.

Re: Problems with math rendering on the web (2020)

#7
post #5

I implemented a TeX engine in WebAssembly so you really can run TeX in the browser. You can see a demo of this at https://tex.rossprogram.org/ and at https://github.com/kisonecat/web2js you can find a Pascal compiler that targets WebAssembly which can compile Knuth's TeX. Interesting primitives like \directjs are also implemented, so you can execute javascript from inside TeX. The rendering is handled with https://gi…

This is wonderful! I'm a wasm neophyte -- even the set up seems complex to me. Do you have any recommendations for where to dive in?

I started by playing with emscripten which manages some of the initial complexity.

Re: Problems with math rendering on the web (2020)

#9

I implemented a TeX engine in WebAssembly so you really can run TeX in the browser. You can see a demo of this at https://tex.rossprogram.org/ and at https://github.com/kisonecat/web2js you can find a Pascal compiler that targets WebAssembly which can compile Knuth's TeX. Interesting primitives like \directjs are also implemented, so you can execute javascript from inside TeX. The rendering is handled with https://gi…

Hello! I'm an osu student that has taken the calc sequence and very much appreciates the effort. I'll be watching the repo for sure

Re: Problems with math rendering on the web (2020)

#10
post #6
post #2

Eh. Every client already renders all the HTML into visual format. I don't see what's wrong with rendering the LaTeX too. Sure it would be nice of browsers could render the LaTeX natively instead of using JS.

given the origin of the web at cern, it's actually surprising that it didn't include LaTeX from day 1.

The web would be so pretty if “HTML” was actually hyperlinked TeX.
Post reply on HN