Web-assembly powered WYSIWYG LaTeX Editor, supporting nearly all LaTeX package
This is amazing.<p>• This seems to be their main page: <a href="https:&#x2F;&#x2F;www.swiftlatex.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.swiftlatex.com&#x2F;</a><p>• Not all the source code is on GitHub; crucially their modification of the TeX engine seems to be distributed only as the two `.wasm` binary files). Not sure if they plan to share more or not.<p>• As mentioned in the FAQ&#x2F;docs page, this is the work of just two people from New Zealand (Gerald Weber and Elliott Wen), and they have a paper about it from 2018 (“SwiftLaTeX: Exploring Web-based True WYSIWYG Editing for Digital Publishing”, DOI: 10.1145&#x2F;3209280.3209522). Based on a quick skim so far, the paper looks fantastic, looking forward to reading it in more detail.<p>• In the paper, Figure 5 and the surrounding text describe how TeX was modified (the part of most interest to me); it&#x27;s really clever! To avoid modifying the data structures and introducing new bugs, they hook only into TeX&#x27;s internal allocation functions for tokens. (TeX as originally written by Knuth does not use malloc() or equivalent; it does all its own allocation out of giant arrays called &quot;mem&quot; and &quot;str&quot;.) They can then look up this bookkeeping when the token lists are being shipped out to PDF format.<p>• Looks like it has some limitations as far as PS&#x2F;PDF specials goes (aka “drivers” in the TeX world), so TikZ or tcolorbox don&#x27;t work too well for example. However my guess is that this is just an issue with their PDF rendering (per the paper they use something like Pdf2htmlEX rather than pdf.js, for speed), and not a fundamental issue.<p>• But otherwise most of the standard LaTeX features and packages seem to work (labels and cross-references, etc); you can \usepackage anything and it will download the corresponding files but no data leaves your system; everything happens in the browser. Heck I even pasted in xii.tex (without the final &quot;jbye&quot;) and it works (can click on “partridge” in the PDF and go to the corresponding part of the source).<p>• This sort of WYSIWYG editing for LaTeX has been done in a couple of proprietary systems before (BaKoMa TeX &#x2F; Texpad), and some ancient systems as well (VorTeX), but they&#x27;ve been buggy in my limited experience. There was also a very impressive demo at this year&#x27;s TUG meeting, by David Fuchs (who Knuth described as his “right-hand man” on the TeX project). All these projects have had to grapple with the same issues (achieving quiescence etc). This one seems to have its share of minor bugs (some artefacts seem to be visible in their published paper too!), so e.g. a feature to fully update the PDF after a (very) long typing pause (or manual user request) seems desirable. Nevertheless it&#x27;s very impressive as it is.<p>• I think some sort of engagement with the TeX community (the mailing lists at <a href="http:&#x2F;&#x2F;tug.org&#x2F;texlive&#x2F;lists.html" rel="nofollow">http:&#x2F;&#x2F;tug.org&#x2F;texlive&#x2F;lists.html</a> etc) may help: it appears their code is currently based on pdfTeX; they should probably consider XeTeX &#x2F; LuaTeX as well (given that the doc page at <a href="https:&#x2F;&#x2F;swiftlatex.readthedocs.io&#x2F;en&#x2F;latest&#x2F;" rel="nofollow">https:&#x2F;&#x2F;swiftlatex.readthedocs.io&#x2F;en&#x2F;latest&#x2F;</a> mentions “Lack of Unicode Support”). There are experts there with some idea of corner cases, the weird things that users want, etc. Hope this becomes part of the TeX mainstream (what little there is of it) to benefit all users (good typesetting for everyone!) and not some sort of edge case that dies when&#x2F;if the authors lose interest.<p>Overall, am really awestruck by all this. Congratulations and good luck to the authors!