4 ms·
LaTeX.wasm: LaTeX Engines in Browsers
- psc007 4mo agoWhy is there no npm registry package?
- joshjob42 4mo agoAdd LuaLaTeX and you're cookin' with gas. For real would be fantastic if we could get more or less the full LaTeX ecosystem readily and rapidly available online and in a huge variety of desktop applications.
- kridsdale1 4mo agoI’m really glad the main AI chatbot apps and sites support latex rendering. I tuned my system prompts to get the bots to explain their high level reasoning in equations for me to read if they think it will convey more nuance or dimensionality than casting down to English.
- fph 4mo agoI'm looking forward to run Lua inside Latex inside Javascript inside Firefox inside my Android ART virtual machine.
- jampekka 4mo agoPlease no. LaTeX and its ecosystem needs to be put out to pasture.
- hulitu 4mo ago> LaTeX Engines in Browsers This is hillarious. Browsers lost the ability to print some 10 years ago. Today, printing a web page is an exercise in masochism. I am very curious how the output will look like.
- jerf 4mo agoOver the years many people have hypothesized that once WASM was really mature, it would become practical to fix the issues with web browser layout by sending down custom layout machines to users. I would find it hilarious if LaTeX turned into a leader in that space. I doubt it could hold on to that. There's a lot of things that something designed from the beginning for web-like uses could probably improve on that would be capable of overcoming LaTeX. But I could see a world where it carves out a niche and holds on to that niche for a long period of time.
- nicoburns 4mo agoRunning layout in WASM is already practical. A good demo is https://www.nicbarker.com/clay https://www.nicbarker.com/clay The things you can't do are things like expose an accessibility tree (without a dummy DOM), interact with the system IME, and access system fonts.
- jerf 4mo agoI feel like it's fair to say that you have not "fixed the issues with browser layout" if you lose accessibility and input. System fonts I can live without, we can push our own, but those two things are a big deal. Even input you might be able to hack around but accessibility is a big deal and the "hack" at that point is nearly to both lay it out in the browser and the supposed "fixed" layout system, and while that may work in some sense I again have lots of questions about whether that is really "fixed".
- nicoburns 4mo agoI mean, I agree it's not fixed. I guess I'm just saying it's not the layout engine that's the blocker. FWIW, I actually think it would be much more valuable just to fix the spec and make CSS layout fast-by-default.
- exe34 4mo agoNowadays I imagine OCR and vllms would solve that? Tesseract is incredibly fast and accurate.
- jerf 4mo agoAccessibility is not just about getting text out. It's about the navigation flow, integration into various OS features, Aria attributes in HTML and what they do. Plus you may not count this as "accessibility" but things like integrating fully with multi-lingual text entry methods. It's solvable, except for what isn't solvable because the browser doesn't expose it, which can be solved by fixing that too. But it's a lot more work than meets the eye. And building the layout engine is hard enough in the first place. Give me a week and an AI budget and I'll produce you some sort of layout engine that works when fed exactly the sorts of inputs I anticipated, but to build something that survives contact with the real world is going to be well beyond something you just prompt your way around today.
- stschaef 4mo agoI immediately received the following error :| This is pdfTeX, Version 3.14159265-2.6-1.40.21 (SwiftLaTeX PDFTeX 0.3.0) (preloaded format=swiftlatexpdftex) I can't find the format file `swiftlatexpdftex.fmt'! Likewise for XeTeX
- kridsdale1 4mo agoSame.
- williamstein 4mo agohttps://www.swiftlatex.com/editor.html https://www.swiftlatex.com/editor.html for the wysiwyg editor says "We are working hard to fix the editor." It has said this for many years. I think I tried it once when it was live and it was pretty cool. My guess is people observed it could corrupt documents, so it was taken down.
- lizhang 4mo ago[dead]
- dunham 4mo agoIs this related to web2js[1], which has been around for a while? It compiles the pascal code of TeX to wasm. It looks like the live demo is no longer up, but it did run latex in the browser and render the dvi output to html. The wasm for TeX is about 495kb / 88kb compressed, but the memory image for LaTeX was a bit larger. [1]: https://github.com/kisonecat/web2js https://github.com/kisonecat/web2js
- christoff12 4mo ago> Due to the way Bibtex works, you may need to compile at least three times to see correct reference numbers in the PDF. I'm not sure I understand why the second or third compile would work, but not the first.
- exe34 4mo agoIn latex, I have to compile once so that it can find out the references it needs, then bibtex so that it extracts the actual references, compile a second time to get the references into the paper and then a third time because a ton of things shift around and now it knows all the figure/page numbers etc.
- nicoburns 4mo agoThis talk contains a really good explanation of this problem (and also discussion around how it's solved in Typst) https://www.youtube.com/watch?v=yWWVhbyOWWE https://www.youtube.com/watch?v=yWWVhbyOWWE
- teh64 4mo agoIt is not 3 compiles of the same code after another, but e.g. latex, bibtex, latex, with each step creating part of the final output. I imagine latex like part of multi-pass compiler, so calling latex once is like running only one stage of the compiler. Latexmk (https://www.ctan.org/pkg/latexmk https://www.ctan.org/pkg/latexmk) solves this problem more elegantly by knowing how often each tool and in what order is required.
- fph 4mo agoThere are Latex documents whose output keeps changing no matter how many times you run Latex on them: https://tex.stackexchange.com/questions/30674/document-requiring-infinitely-many-compiler-passes https://tex.stackexchange.com/questions/30674/document-requi...
- andai 4mo agoI might be interested in running this offline too. Every time I try to do anything with LaTeX it pulls gigabytes of stuff but it's somehow still not batteries-included. I'm assuming this distribution is a bit more curated and out-of-the-box.
- casey2 4mo agoPretty funny that there is both an installation and that its not cross platform. What is the point of web assembly again?
- gs17 4mo agoI really hope it can get LuaTeX support at some point, and SVG output added back in (although it hasn't been updated in two years, so it might be up to me). I have a project where this would solve a big problem if it had both of those. TikZJax might solve it better but it also doesn't support LuaTeX either and it feels like a bigger ask.
- nl5874 4mo agoHere is also one based on the tectonic latex engine: https://github.com/nl5887/tectonic-wasm https://github.com/nl5887/tectonic-wasm
- akst 4mo agoIs anyone else where familiar with MathML[1] and tried using it place of LaTeX? Obviously not a replacement for all usecase of the above package (like rendering existing documents), but I use mostly for rendering math here and there in my own notes, I prefer it as I can render math without any dependencies, some examples here [2]. That said I'm my own user and mostly view it the same browser, but I've heard there are inconsistencies in rendering in different browsers. [1] https://developer.mozilla.org/en-US/docs/Web/MathML https://developer.mozilla.org/en-US/docs/Web/MathML [2] https://akst.io/notes/?app=unsw.3202.07#uc-widget-0-title-13 https://akst.io/notes/?app=unsw.3202.07#uc-widget-0-title-13