| ▲ | Show HN: <15MB Local-first Interactive LaTeX Scratchpad in the Browser(telox.dev) | |
| 3 points by eigenblake 11 hours ago | ||
I am working on a very modular typesetting engine called TeLoX, intended as a superset of the capabilities (of at least) XeTeX and pdfLaTeX, written in Rust. The main goals are modularity and speed (which we know sometimes fight each other unless we try to be principled about it). Today I wanted to demonstrate these diegetic interactive sliders that control values within in LaTeX from the browser (kinda like marimo). This isn't meant to be a complete editor like quicklatex and texlyre -- just a tiny playground that loads quickly enough and responds interactively to see how good I can get the typing experience to be. Package support is the weakest link right now so lots of reasonable LaTeX you type up will fail. Increasing coverage fights against fast load times, and so I'll add some 'code splitting' -- I can make the editor dynamically fetch cached blobs for the most common $k$ packages and see how much time that buys me. After I add support for Lua or some other simple expression language, seems like you could make some really beautiful receipts/calculators fairly easily. The other interesting thing you'll notice is that clicking and dragging on text selects the associated input text really accurately, down to the word. I have an art project that I was working on that was blocked by this exact issue -- being unable to correctly attribute a click back to the exact word that generated it (essentially an interactive storybook, WYSIWYG computational notebook with diegetic inputs). That's now unblocked. I wanted to make a choose-your-own adventure game that takes place _in_ a book on the web. This whole thing is quite difficult, but I think it's worth it. I know it's an ambitious notion to bring arbitrary support for arbitrary LaTeX to arbitrary devices, but it feels like it's leading somewhere interesting. Desktop gives the best experience for now, and even still it loads slower than I'd like at ~2.5 sec on cold boot. I should probably default mobile to view mode. A PWA version, bookmarklet support for typesetting the current page, etc, all possible, not started yet. I'm most interested in optimizing my in-memory representation first, and if that's not enough, I'd make a lexical dependency tracker for the TeX interpreter under the hood and deal with mutations/overwriting in a sensible way, possibly svelte style. Like I said, a lot of work. Sharing now before my semester kicks in and my free time is gone. "Baby steps," as they say. | ||