Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I never understood math / latex display via client side js.

Why can't this be precomputed into html and css?



> I never understood math / latex display via client side js. Why can't this be precomputed into html and css?

It can be. But like I mentioned earlier, my personal website is a hobby project I've been running since my university days. It's built with Common Lisp (CL), which is part of the fun for me. It's not just about the end result, but also about enjoying the process.

While precomputing HTML and CSS is definitely a viable approach, I've been reluctant to introduce Node or other tooling outside the CL ecosystem into this project. I wouldn't have hesitated to add this extra tooling on any other project, but here I do. I like to keep the stack simple here, since this website is not just a utility; it is also my small creative playground, and I want to enjoy whatever I do here.


Perhaps you could stand up a small service on another host using headless chrome or similar to render, and fall back to client side if the service is down and you don’t already have the pre rendered result stored somewhere. I suggest this only because you mentioned not wanting to pollute your current server environment, and I enjoy seeing these kind of optimizations done :^)


What you are suggesting is adding massive complexity.


Is it safe to say the website is your passion project?


It’s a bit more work, usually you’re going to have to install Node, Babel and some other tooling, and spend some time learning to use them if you’re not already familiar with them.


For rendering math to HTML+CSS or SVGs, you can just use Node.js and MathJax. I'm not sure why you'd want Babel.

(You can probably use KaTeX, too, but I prefer the look of MathJax's output.)


Well there is mathml but it has poor support in chrome til recently. That is the website native equations formatting.


I usually prefer compiling it to HTML or SVGs, but sometimes, if you have a lot of math on your page, bundling MathJax can take up less space. (Not sure if that'd still be true after compression.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: