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.
Nobody else seemed convinced :(
First, font support is purely by reference which means that you need some way of connecting the fonts used in the document with the DVI file. Use of the wrong font could produce some spectacularly bad output.
Second, graphical support, other than rectangular boxes is only handled through the xxx opcode which never had any standardized meaning (although I tried). This limitation also applied to colors. Really, it was only with the final victory of PDF as the universal document format that these limitations were finally ameliorated.
In 1993/94 ? It was a much stronger candidate, and given that any DVI (including images) could be rendered into PDF (or whatever), its supposed technical limitations at that time were not of much significance.
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.
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".
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.
FWIW, I actually think it would be much more valuable just to fix the spec and make CSS layout fast-by-default.
The reason why I consider it a possibility is that LaTeX has two things out of the gate: The technical capability, and a small but arguably rabid user base. It's the sort of thing that can take an early lead but is quite unlikely to sustain it.
But you can't deny that LaTeX has had incredible staying power, despite the list of issues that everyone who uses it has with it.
Now if only the browser conglomerates can disrupt Pantone too...
We already have a very powerful layouting engine: the web browser. The only missing piece is printing/pagination, for which there was some CSS Paged Media progress, but that stalled.
However, why the hell are we even doing paged media? For screen viewing it's strictly worse, and very few people print papers anymore. And even for those HTML pages print passably enough.
In many fields citing a page is also quite rare.
For example, it's pretty easy to use CSS counters to create as many automatically incrementing counters as you need. Page number, section number, theorem number, etc. But (a) you can't do this in raw HTML, which means you can't rely on this working in any user agent that has poor support for CSS; and (b) you can't refer to the values of those counters outside of CSS. Thus, there's no way for you, as an author, to write the write the equivalent of LaTeX's "See Theorem~\ref{thm:foo}" in HTML and rely on having it auto-numbered and rendered correctly wherever your readers are. So the number has to already be there as text in the HTML, and you need a separate, document-unique id attribute coordinated with the number to use for linking. This means you need a separate compilation step to produce the HTML, so you've lost pretty much the only advantage that HTML had over LaTeX.
But fundamentally, the problem is that citation practices assume that the reading format is controlled by the author/publisher, so that all readers are looking at a common view of the document, whereas the Web assumes that the reading format is controlled by the user agent, and user agents vary widely. Thus, on the Web, you need formatting-independent citation practices, which have not yet evolved, or at least not become widely used, because it's too hard compared to page-based media, which have been working for centuries.
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
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.
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
[2] https://akst.io/notes/?app=unsw.3202.07#uc-widget-0-title-13
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.
I'm not sure I understand why the second or third compile would work, but not the first.