frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

TikZJax: Embedding LaTeX Drawings in HTML

https://tikzjax.com/
137•steventhedev•9mo ago

Comments

Garlef•9mo ago
Hm. Either that page or the tech itself is not great on mobile.
ano-ther•9mo ago
Takes a second or so to load on mine (iOS Safari). But then it shows correctly, even if the second diagram is a bit small (it fits in a quarter of the 1in circle).
frumplestlatz•9mo ago
It crashes (“a problem repeatedly occurred”) a few seconds after loading everything on my device (also iOS Safari).

I love tikz, but lightweight it is not; it’s not a huge surprise it takes a few seconds to render.

No idea what’s causing the crash, though.

kccqzy•9mo ago
Well iOS Safari is in general buggy and tends to display the "a problem repeatedly occurred" message on many other slightly heavy web pages. This web page shouldn't be blamed for causing Safari to crash.
frumplestlatz•9mo ago
Nobody is assigning blame, we don’t know the root cause.

I could just as easily say that Safari shouldn’t be blamed for a buggy website, but I’d be overreaching just as much as you just did.

kccqzy•9mo ago
By definition buggy websites that crash the browser are bugs in the browser.

It may have security implications, or it may not. It might just be an innocent case of someone using assertions instead of proper error reporting. Nevertheless it's a bug in the browser.

frumplestlatz•9mo ago
Safari will terminate a page for using excess resources with the same message.
kccqzy•9mo ago
So? Still Safari's problem for not displaying a proper error message.
frumplestlatz•9mo ago
Sounds like you just dislike Safari. Doesn’t seem to be much help here.
kccqzy•9mo ago
No. Safari chose the exact wrong way to handle this case. Let's suppose some webpage is in fact allocating too much memory. It is the user agent's job to inform the user of this fact. What does Safari do? It silently crashes. It's not even about displaying the wrong error message here: the handler for the crash is to simply refresh the page and render it again. But this is exactly the wrong way to handle out-of-memory errors: chances are the web page will again allocate too much memory and crash yet again. In the end the final displayed error message is "a problem repeatedly occurred" with no reference to the nature of the problem.

I hate this trend of hiding error messages from the user. Apple as a company known for its attention to detail in UI, should have been the one company especially dedicated to presenting a good error message without overwhelming the user with technical details—it is supposed to be the master in user communication. And it is not. Hence my disappointment.

Jaxan•9mo ago
It doesn’t crash, but tells me there is a problem. To me,this seems like a safe way to deal with buggy websites.
revskill•9mo ago
The author does not have an iphone to test.
ics•9mo ago
Jim Fowler seemed like Calculus' biggest hype man when the MOOC ball was just starting to roll. If you're looking to brush up and like the more energetic/engaging style I'd recommend checking out his videos on YouTube or elsewhere.

> Using web2js, the Pascal source of tex is compiled to WebAssembly; the latex format is loaded (without all the hyphenation data), and [...] is executed. Then core is dumped; the resulting core is compressed, and by reloading the dumped core in the browser, it is possible to very quickly get to a point where TikZ can be executed. By using an SVG driver for PGF along with dvi2html, the DVI output is converted to an SVG.

This is the kind of hack I'm here for.

3abiton•9mo ago
Thanks for the recommendation, this is really cool!
kisonecat•9mo ago
Indeed, you can find my calculus videos at https://www.youtube.com/kisonecat

But maybe for a coding audience https://www.youtube.com/watch?v=MVtlD22Y8SQ is more entertaining.

frumplestlatz•9mo ago
Using a “core dump” (dumping the webassembly heap) is an interesting optimization approach with historical precedent both in TeX itself and projects like Emacs (dump/unexec) — https://www.gnu.org/software/emacs/manual/html_node/elisp/Bu...

It’s also notoriously fragile and non-portable on native targets; I’m curious how one implements it under webassembly, and how it compares.

drfuchs•9mo ago
Being able to start a process, have it run for a bit to, say, read in initialization data, populating dynamic data structures along the way, and then interrupt the process and save the whole state as a new executable, was a feature built into DEC’s Tops10 and Tops20 operating systems / standard runtimes, along with related custom systems like Waits, under which TeX was developed. It took just two lines of code for TeX to implement its side of this feature on those first platforms.

It came as a bit of a shock at the time that all the Unix-y systems had no such native concept, and that fragile, non-portable user-space schemes were required to mimic this functionality.

vdm•9mo ago
Checkpoint/Restore In Userspace https://criu.org/
kisonecat•9mo ago
Resurrecting this workflow was one of the funniest things in implementing TikZJax.
kisonecat•9mo ago
Author of TikZJax here...

I'm endlessly distracted by other things at work, but I believe this same idea could also be used to provide real-time compilation of TeX'd documents as they're typed. Simon Rubinstein-Salzedo had suggested wanting something like a real-time Overleaf to teach his classes at https://eulercircle.com/ Interrupting and resurrecting the TeX-in-the-browser would let you render a document as it is typed.

svat•9mo ago
See also (if you haven't already) SwiftLaTeX ( https://www.swiftlatex.com/ https://github.com/SwiftLaTeX ) and their paper (DOI: 10.1145/3209280.3209522 ).
apetresc•9mo ago
Funny seeing this on the front page – I'm coding a project as I'm browsing this that makes heavy use of TikZJax.

Overall, I'm impressed by how seamlessly it works when it does work. But it's not perfect:

- Some core library functions (for example, most types of fill patterns) simply don't work or aren't implemented for some reason.

- There are a few long-standing bugs. For instance, if using the intersections library to compute the intersection of a line and a circle, it straight-up crashes the entire TikZJax process. Intersections of two lines or two circles are fine, but circle+line fails. My attempts at diagnosing this seem to indicate that it's running out of stack space, so maybe the original TikZ code uses some inefficient recursive algorithm to compute this intersection, and this exceeds some stack size limit that the WebAssembly version introduces. I'm not sure and I haven't been able to get much traction.

- The project doesn't seem to get any love from the original developers anymore. I've filed multiple bugs for months now that never get any form of acknowledgement.

- The build process is pretty convoluted and difficult to reproduce (to try to fix those aforementioned bugs myself), which I guess is what you'd expect from a project that attempts to cross-compile a 20-year-old macro package for a 50-year-old Pascal codebase for rendering in the browser.

Overall I'm very glad TikZJax exists and there's still no better-looking and convenient-to-author diagramming language than TikZ itself. But there's definitely rough edges.

steventhedev•9mo ago
Apparently there are some forks that offer more features and fix some of those bugs. Maybe one of those can help you?

This is the one that was shared on lobsters, but there are likely more: https://bill-ion.github.io/tikzjax-live/

kisonecat•9mo ago
As the author of TikZJax, I can certainly apologize for not making more progress on this.

I need to get back to this project! I'd very much like to clean up the build process.

xenonite•9mo ago
While live rendering is nice, I suppose that generating static SVGs that are embedded in a static webpage generator are more fruitful for the typical case. A quick search yielded this: https://polbarrachina.com/2022/05/23/latex-and-tikz-in-jekyl...
psychoslave•9mo ago
In a wiki setting for example, it might be nice as it makes the direct human edition more accessible. Not as accessible as an embedded SVG editor of course. But still, compare how latex formula are used in Wikipedia, compared to mathml, or SVG.
steventhedev•9mo ago
I'm fond of using KaTeX for my personal blog posts. There is support for server side rendering for KaTeX (but not on GitHub pages because it necessarily opens it to arbitrary code execution - I asked).

But it notably lacks tikz support and if it can emit SVGs I'm beginning to wonder why I even use KaTeX and not something like this (beyond my personal anti-JS sentiment)

klabetron•9mo ago
Holy smokes. That’s a name I haven’t heard in a while. I submitted many calculus homework assignments in LaTeX because Jim introduced it to me back at our high school. (Go Mankato West Scarlets!)
kisonecat•9mo ago
Matt Klaber?! If so, great to run into you!

I mean, I'm guessing from "klabetron"... Unfortunately I don't think my "kisonecat" gives much clue to "Fowler".

klabetron•9mo ago
lol yep
ycombinatrix•9mo ago
this looks cool. i guess i would generally prefer to do the SVG rendering on the server rather than on the client.

Moltbook

https://www.moltbook.com/
336•teej•5h ago•163 comments

OpenClaw – Moltbot Renamed Again

https://openclaw.ai/blog/introducing-openclaw
123•ed•3h ago•41 comments

How AI Impacts Skill Formation

https://arxiv.org/abs/2601.20245
59•northfield27•1h ago•27 comments

Grid: Free, local-first, browser-based 3D printing/CNC/laser slicer

https://grid.space/stem/
282•cyrusradfar•10h ago•97 comments

PlayStation 2 Recompilation Project Is Absolutely Incredible

https://redgamingtech.com/playstation-2-recompilation-project-is-absolutely-incredible/
419•croes•14h ago•194 comments

Software Pump and Dump

http://tautvilas.lt/software-pump-and-dump/
18•brisky•3d ago•3 comments

Project Genie: Experimenting with infinite, interactive worlds

https://blog.google/innovation-and-ai/models-and-research/google-deepmind/project-genie/
567•meetpateltech•16h ago•275 comments

Doin' It with a 555: One Chip to Rule Them All

https://aashvik.com/posts/555-revolution/
32•MonkeyClub•2d ago•17 comments

Claude Code daily benchmarks for degradation tracking

https://marginlab.ai/trackers/claude-code/
663•qwesr123•19h ago•308 comments

Photoroom (YC S20) Is Hiring a Head of Cross-Platform (Rust) in Paris

https://jobs.ashbyhq.com/photoroom/dc994a7c-e104-46e1-81c3-b88d635398b9
1•ea016•2h ago

Retiring GPT-4o, GPT-4.1, GPT-4.1 mini, and OpenAI o4-mini in ChatGPT

https://openai.com/index/retiring-gpt-4o-and-older-models/
185•rd•12h ago•253 comments

Stargaze: SpaceX's Space Situational Awareness System

https://starlink.com/updates/stargaze
79•hnburnsy•5h ago•20 comments

How AI assistance impacts the formation of coding skills

https://www.anthropic.com/research/AI-assistance-coding-skills
37•vismit2000•3h ago•5 comments

GOG: Linux "the next major frontier" for gaming as it works on a native client

https://www.xda-developers.com/gog-calls-linux-the-next-major-frontier-for-gaming-as-it-works-on-...
28•franczesko•54m ago•3 comments

AGENTS.md outperforms skills in our agent evals

https://vercel.com/blog/agents-md-outperforms-skills-in-our-agent-evals
326•maximedupre•19h ago•137 comments

Backseat Software

https://blog.mikeswanson.com/backseat-software/
92•zdw•10h ago•15 comments

The Dank Case for Scrolling Window Managers

https://tedium.co/2026/01/29/niri-danklinux-scrolling-window-managers/
73•todsacerdoti•4h ago•33 comments

The WiFi only works when it's raining (2024)

https://predr.ag/blog/wifi-only-works-when-its-raining/
178•epicalex•12h ago•54 comments

Nannou – A creative coding framework for Rust

https://github.com/nannou-org/nannou
27•dmit•2d ago•3 comments

Flameshot

https://github.com/flameshot-org/flameshot
186•OsrsNeedsf2P•13h ago•70 comments

Spacecurve: A space-filling curve playground

https://corte.si/posts/spacecurve/announce/
11•cortesi•2d ago•2 comments

Show HN: Mystral Native – Run JavaScript games natively with WebGPU (no browser)

https://github.com/mystralengine/mystralnative
25•Flux159•2d ago•3 comments

The paper model houses of Peter Fritz (2013)

https://socks-studio.com/2013/12/06/the-imaginary-town-of-an-unconscious-architect-the-387-paper-...
18•NaOH•2d ago•1 comments

My Mom and Dr. DeepSeek (2025)

https://restofworld.org/2025/ai-chatbot-china-sick/
181•kieto•14h ago•94 comments

Two days of oatmeal reduce cholesterol level

https://www.uni-bonn.de/en/news/017-2026
133•brandonb•6h ago•91 comments

CISA’s acting head uploaded sensitive files into public version of ChatGPT

https://www.politico.com/news/2026/01/27/cisa-madhu-gottumukkala-chatgpt-00749361
148•rurp•2d ago•218 comments

A lot of population numbers are fake

https://davidoks.blog/p/a-lot-of-population-numbers-are-fake
334•bookofjoe•19h ago•279 comments

Is the RAM shortage killing small VPS hosts?

https://www.fourplex.net/2026/01/29/is-the-ram-shortage-killing-small-vps-hosts/
171•neelc•17h ago•198 comments

Launch HN: AgentMail (YC S25) – An API that gives agents their own email inboxes

144•Haakam21•16h ago•148 comments

The Home Computer Hybrids: Atari, TI, and the FCC

https://technicshistory.com/2026/01/25/the-home-computer-hybrids/
21•cfmcdonald•3d ago•1 comments