Web-assembly powered WYSIWYG LaTeX Editor, supporting nearly all LaTeX package
github.com
github.com
• This seems to be their main page: https://www.swiftlatex.com/
• 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.
• As mentioned in the FAQ/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/3209280.3209522). Based on a quick skim so far, the paper looks fantastic, looking forward to reading it in more detail.
• In the paper, Figure 5 and the surrounding text describe how TeX was modified (the part of most interest to me); it's really clever! To avoid modifying the data structures and introducing new bugs, they hook only into TeX'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 "mem" and "str".) They can then look up this bookkeeping when the token lists are being shipped out to PDF format.
• Looks like it has some limitations as far as PS/PDF specials goes (aka “drivers” in the TeX world), so TikZ or tcolorbox don'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.
• 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 "jbye") and it works (can click on “partridge” in the PDF and go to the corresponding part of the source).
• This sort of WYSIWYG editing for LaTeX has been done in a couple of proprietary systems before (BaKoMa TeX / Texpad), and some ancient systems as well (VorTeX), but they've been buggy in my limited experience. There was also a very impressive demo at this year'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's very impressive as it is.
• I think some sort of engagement with the TeX community (the mailing lists at http://tug.org/texlive/lists.html etc) may help: it appears their code is currently based on pdfTeX; they should probably consider XeTeX / LuaTeX as well (given that the doc page at https://swiftlatex.readthedocs.io/en/latest/ 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/if the authors lose interest.
Overall, am really awestruck by all this. Congratulations and good luck to the authors!
I'm interested if it can be self hosted for using in a commercial environment. This would be a killer feature for increasing Latex adoption at corporations stuck with MS Word.
Interestingly, their CLA specifies UK law, but they are based in New Zealand.
Can you explain the logic of this argument? I don't understand it. That's the whole point of the AGPL, that you release your changes.
IANAL, however.
TeXmacs is fine, but one difference is I can imagine laying an etherpad style coordination layer over this and getting something new.
If you want a structured scientific web editor with collaboration, check out also https://www.fiduswriter.org/. Built on top of ProseMirror.
But Fidus is closer to "WYSIWYM" like LyX — structured editing with "acceptable" typesetting, and TeX export for high-quality typesetting. TeXmacs shoots for true "what you get" high-quality typesetting as you edit. Mind you, the edited model is structured in "what you mean" spirit (with quite good UX to "see" the structure), not flat "slap formatting on characters" model typical of WYSIWYG editors.
I thought one of the selling points of webassembly is that wasm files must have a textual format that anyone can read the source.
We reached a point where everyone was distributing browser code as minimized javascript to the point where reading the source of web pages wasn't really meaningful anymore. At least this way you can technically read the webassembly in something that is standardized. Anything can still be obfuscated though. The idea of a pure, readable webpages is long gone, but if they made the code clean and didn't do any trickery then it's still possible to read if you know the format.
Open and debuggable
WebAssembly is designed to be pretty-printed in a textual format for debugging, testing, experimenting, optimizing, learning, teaching, and writing programs by hand. The textual format will be used when viewing the source of Wasm modules on the web.
Will WebAssembly support View Source on the Web?
Yes! WebAssembly defines a text format to be rendered when developers view the source of a WebAssembly module in any developer tool. Also, a specific goal of the text format is to allow developers to write WebAssembly modules by hand for testing, experimenting, optimizing, learning and teaching purposes. In fact, by dropping all the coercions required by asm.js validation, the WebAssembly text format should be much more natural to read and write than asm.js. Outside the browser, command-line and online tools that convert between text and binary will also be made readily available. Lastly, a scalable form of source maps is also being considered as part of the WebAssembly tooling story.
PdfTeX is GPL-licensed, so if this is derived from pdfTeX (is it?), I assume they'd be required to make their source available. (Note that the GPL says that "the source code for a work means the preferred form of the work for making modifications to it", which I don't think would be a .wasm binary file.)
However, this is still an awesome editor, and I would probably have loved to use the near-instant WYSIWYG updates for more complex and layout-sensitive parts of papers, like tables and such. I'd just wish this editor would allow to disable the distracting layout rendering completely for "dump-text-from-brain" phases.
I have noticed these different approaches, text as 'data' irrespective of presentation and text as an element part of a holistic piece of work, to be strongly preferred by different people and either of them struggling to be productive when mismatched.
So far, it’s working for me. Along with GNU make, Inkscape (for turning SVG to PDF), I’ve been happy with what I have with minimal embedded layout.
Do you have an example or blog post? Very interested in seeing the macro part and everything pulled together.
No. But redoing it all from scratch and getting mindshare is difficult.
Substance.io is one project I've followed for years who aim to do this, and the time, false starts etc show just how tricky it is. https://twitter.com/_mql/status/1202200085288935430
One could argue that Adobe InDesign, Quark XPress et al are the replacement. They have the typesetting and layout capabilities that common software lacks.
i think it's more because it does not really matter for most people. not because it's too difficult.
there are companies today that can put the resources to the task. i am just going to assume that the priorities are elsewhere.
The two halves of that sentence seem to be in conflict. Could you say more?
> […] but today such features [should] be in very core of text system no in some software branch
No, that is mistaken. As the FAQ says, "Development of pdfTeX has mostly stopped" https://texfaq.org/FAQ-enginedev, in favor of LuaTeX (and XeTeX maintanence). But users use what they use and the people who put together the distribution do not normally shut things down, so pdftex remains. (I admit I often use it.)
I'm not much of a biblio person myself but I find that biblatex and biber work for me. I think I remember someone saying that they could use more developers, but in any event I'm sure that someone who volunteered to pitch in would be welcome.
If a person would like to see some more development but does not have the energy or the skills then the best thing to do is to join a Users Group, such as TUG at https://www.tug.org/. Or you could simply make a contribution so that some developer could get funding.
We are teaching this combination since 7 years now to physics students and I have been using it for nearly all documents I created. That includes bachelor and master thesis, dozens of beamer presentations and currently wip PhD thesis.
Our (German) material ca be found here:
https://toolbox.pep-dortmund.org
Direct link to slides: https://toolbox.pep-dortmund.org/files/archive/latest/latex....
Is pdfTex clearly labeled "do not use" and development has stopped completely? Also, do lualatex/biber/biblatex all have feature parity and are clearly documented as the "true" latex projects that are the only ones which should be used currently?
If there weren't two "yes"'s in response then OP's clear criticism will remain a problem. It cannot be escaped by advising the user to jump to a different branch based off the last downside they happened to describe about their chosen branch. (E.g., "I want unicode" -> "use lualatex", "I want WYSIWYG" -> "use SwiftLatex", "But what about unicode" -> "use lualatex", ad infinitum)
Over the last couple of years, pdftex, xetex and luatex have coexisted and pdftex was the stable choice and the other two were functional but in beta stage. In the last years, xe and luatex became stable and pdftex entered maintenance mode.
WYSIWYG is an antithesis to LaTeX, but I'm sure it's possible to base something like SwiftLaTeX on luatex instead of pdftex.
This has changed only in the last few years.
You listed a few requirements, and while many are achievable using pdftex, only lualatex tikz all the boxes.
* unicode out of the box * otf font support * unicode in bib via biber / biblatex * easy extensibility by writing lua instead of plain tex
there is more.
But only because luatex is out of beta, does not mean pdftex suddenly stops working or needs to be deprecated.
Also:
>lack of utf-8 and TrueType fonts supports
There's UTF-8 support in the standard pdfLaTeX compiler and TrueType support in XeTeX (which is far far from a trivial issue, which is why there are two branches, if you don't need TT fonts you're better off with pdfLaTeX which has more support for e.g. microtypographical adjustments).
It's just like that example of cars mostly replacing trucks in the US. Trucks aren't obsolete, but most don't need them so choose alternatives that fit their life better.
Latex was replaced by Microsoft Word, Adobe InDesign, and Markdown. Each one is different but for people who might have used Latex for a certain use case, one of those more specialized tools might be better. But there will always be a need for Latex itself.
In Indesign I wasted so much time figuring out how to get the layout, the formatting, the figures, code samples, mathematics, bibliography, even page numbering, index and footers I wanted that I had to give up.
The power of bibtex, TikZ, and other packages in the TeX ecosystem make it possible to use a system that produces just the sort of documents that I want—and the software is infinitely less expensive (it doesn’t cost anything).
TeX isn’t without its difficulties. I’ve been programming for over 50 years and still dread diving into the macro language based code for complex packages—but at least it’s available, something you can’t say about these other proprietary systems.
TeX was written by a Computer Scientist (perhaps the most eminent Computer Scientist) and it shows. Its real power is revealed only to those able to program. This is a shame, because using it has made me appreciate good typesetting—something I’ve found difficult to achieve in the kind of papers I write when I use other tools.
I use MS Word when my recipient needs it that way, I use Apple Pages or Google Docs for simple documents when I don’t care what they look like, and Markdown or Org mode for my own notes. For anything important or for something I want to have as archival source (TeX is a purposely frozen format) I use TeX and its related tools, LaTeX etc.
Give it some time, it may grow on you.
I don't believe I'll ever have a deep enough grasp to be able to do those more complex tasks on my own, and that really bothers me. I can imagine some syntax improvements, but like a sibling comment said, I don't see the mindshare shift happening any time soon.
UTF-8 is supported by all modern engines. It's just that it wasn't the default for pdfTeX so you had to add one line to enable it. But this has changed in 2018 [1], so UTF-8 is now th default LaTeX encoding even when using good old pdfTeX.
[1] https://www.texdev.net/2018/03/25/latex2e-utf-8-as-standard/
At the time, the idea struck me as utterly impossible.
I remember talking to a colleague about the possibility of a TeX system that would rerender a page as it was typed in one screen and viewed in another. Ok
[0]: https://www.overleaf.com/ [1]: https://bitbucket.org/iMitwe/my-thesis/src/master/inegalites...
The checkpointing thing is very impressive... typing + update is near instant. Never seen that before.
With that disclaimer I can safely contend that Google/MSFT will not be interested in this. LaTex is for academic typesetting, with a special focus on math-y content. Even with WYSIWYG, every now and then one will need to get into the weeds of Tex syntax, which is simply not for the average computer user.
As for academia, they will not pay a Google/Microsoft for LaTex use when they might as well use Lyx/Kile or their favorite editor with some syntax highlighting support for Tex. And unlike regular note taking, academic writing isn't so spontaneous that you start editing your IEEE manuscript on the pot, while on your phone.
My guess is that the FAANG tribe have little incentive to commercialize this, and hence acquire it
They have published a list of institutions using Overleaf here: https://www.overleaf.com/for/universities
But the reality is that outside of making office run on other platforms, there has been near zero innovation from Microsoft.
Really cannot recommend it enough. :)
———
It's good to see competition in this space as LyX's development has slowed the last few years. I still like it, but will be interested to try this alternative.
Only slight nit is the blue progress bar/page load bar that appears across the top of the screen while you're typing is annoying. And the baseline kerning of the fonts in math mode seem a bit off: $$x^2 + 2x + 1$$ has the x in 2x a bit raised
Is there any way to divide the screen horizontally instead of vertically for use with widescreens? Did not find an option at first glance.
Not everyone enjoys programming their documents and visual editors for LateX written in Motif were the first ones to become available.
"Oops Error Detected! Looks like there was a problem when creating the project: DataCloneError: Failed to store record in an IDBObjectStore: BlobURLs are not yet supported."
I assume Google Drive files can be simultaneously edited by multiple people? If so, then this represents a real competitor to Overleaf.
Regardless, I suppose I was mistaken on what the project was. I assumed it was like a WYSIWYG version of Lyx in the browser. You're still writing Latex with this.
Somebody should write an application called pythonlatex in swift!
Even though I prefer to write everything locally, I've been forced to use overleaf due to the fact that my collaborator forced me to do so.
But, with this speed, I will probably throw away overleaf. :)
Tried creating a Tufte-style book using the provided template. Failed because of a missing file.
There was a paper posted here a couple months ago that claimed that even expert LaTeX users wrote documents slower than novice Word users, but the interesting caveat is that LaTeX users were far faster across the board when the text included a lot of math.
You can easily solve versioning and collaboration issues because the input is plain text (like source code, just version control it and use patches, PRs, etc.) This works better than "track changes" in practice, especially with multiple authors.
So those are the upsides. Downsides: it's a bit esoteric, and clunky for lots of documentation tasks. The implementation is complex and the package/module system can step all over itself. If you have output that is nearly but not quite right, it can be a real bear to fix it.
These days Markdown may be a better choice for a lot of simple documentation tasks where you don't care much about the final output presentation details. Any word processor can probably let you do some things more quickly.
When I was a grad student I knew multiple people in STEM fields who tried to do their thesis in Word (or equivalent) and gave up in frustration, moving it all to LaTeX. I never knew anyone who successfully went the other direction. I don't know if that is still the case.
If you use it a lot, you may find yourself wanting to use it for everything (letters, resumes, presentations, etc.) but many of those things aren't particularly strengths. If you don't use it a lot you will find it hard to come back to casually.
One other strength I should mention, especially for automated documentation. Knuth was very particular about stability in TeX, and LaTeX has mostly-kinda-sorta followed this philosophy. So unless you have used a lot of marginal packages or something, it's entirely reasonable to expect that processing a 20 year old input will work fine using current builds. This is not something you can say of most systems.
Ha! I started my thesis in LaTeX but my adviser only wanted a word document for reading it, so I had to go the other way :)
One person I knew gave up on word when it suddenly lost half a dozen figures they no longer had the originals for. Never did figure out what the mechanism was, but you bet they became more disciplined about backups.
I'm sure it's much more reliable today, but once you had a long document with a bunch of figures, tables, and equations in it, Word started doing odd things. Including just refusing input for a couple of minutes with no message, then crashing. Good times.
> Known bug lists
> 1. WYSIWYG
I agree. The first bug is that it is WYSIWYG. ;-)
Oh that's not what they meant. Or is it a clever innuendo ?
/Joke
## Praise of WYSIWYM (WYM for "what you mean")
Seriously, I wrote my Ph.D. as LaTeX source code with the help of LaTeX-mode in Emacs, including colored syntax highlighting, and was/am very happy.
As explained in a number of places, the point is to write for content without diluting your brainpower with appearance issues.
Moreover it is a common experience that proofreading a rendered copy allows the brain to more easily find typos without the filtering effect that cause one to miss them in a document being edited WYSIWYG fashion.
Also, editing source code has the nice property that there is no hidden state. Ever been annoyed in Word or Google Docs by undesired formatting conflict on a copy-paste? (yes I know "paste as plain text") Also, bullet list with some bullets having mysteriously different appearance from their siblings and you can't fix it. With sane source document editing these issues cannot happen.
## What next
That said, imagine a hybrid future from assertions below:
* I now use asciidoc as it is simpler to edit (much simpler for things like tables), and have a toolchain that renders it to PDF via LaTeX (the xsl-fo path was never near as visually clean). I wrote a LaTeX style for my personal freelancing company (quotes, invoices, reports, technical documentation) and the fact that one cannot deviate from the style is a feature.
* Side-by-side source+rendered editing somehow can make sense.
* There is practical educational value to let newcomers benefit from LaTeX power and rendering quality with the WYSIWYG they still perceive as comfortable, some will migrate to source editing.
* This project could spawn some variants with other rendering engines.
* Did they solve all the problems with cursor positioning (see "text editing hates you" mentioned here on HN recently) ? In many cases, several visual positions correspond to same source position and vice versa.
* What will happen in practice is the tech will be applied to some other places, which is the very point of public research. That reminds me the project Boomerang. https://www.seas.upenn.edu/~harmony/ there is probably some common ground between those projects.