6
$\begingroup$

Mathjax is slow enough that for math-heavy questions or answers my Safari 10 can barely keep up on a 3 years old mac (I am giving these details for precision sake: this is not a bug report but a feature request!). I have been experimenting with KaTeX for my own stuff and I am very impressed with the speed. Their web page offers an interactive sandbox to try it. It has been around for a while and it supports most of what Mathjax does, including matrices, underbrace, a lot of AMS math. The most glaring missing feature is the lack of support for equation numbers (not even \tag is supported) and it might be considered a showstopper for stackexchange. Anyway, I think this is worth a discussion.

$\endgroup$
  • 2
    $\begingroup$ Relevant: math.meta.stackexchange.com/q/16809 $\endgroup$ – Sir Cumference Sep 15 '17 at 3:55
  • $\begingroup$ The issues mentioned in Willie Wong's answer on that metaMSE thread, as well as several comments, sound like show-stoppers to me ─ but the thread is three years old. Since you're pushing for this, maybe you can do a review and see whether the issues still stand? $\endgroup$ – Emilio Pisanty Sep 15 '17 at 9:13
  • 1
    $\begingroup$ Also, one option would be to add KaTeX as an opt-in, either via user settings or via a user-script (if it's possible to modify the html before the MathJax js gets loaded?). We could then test how well it deals with those kinds of issues without breaking the site for everyone. $\endgroup$ – Emilio Pisanty Sep 15 '17 at 9:15
  • 4
    $\begingroup$ And, another thing to keep in mind: Stack Overflow Inc is a partner of MathJax, with the same standing within its governance as IEEE and Elsevier, and higher than, say APS and IOP, and including a seat on the steering committee. I expect it will take a lot of convincing to convince SO to drop their institutional support and take up with the competition, simply because there's a lot of inertia in institutional support for open-source projects (which I think is a good thing). $\endgroup$ – Emilio Pisanty Sep 15 '17 at 9:18
  • $\begingroup$ I will go through the metaMSE thread and check every issue. But a quick glance already shows that some major showstopper are gone: matrices are supported for example now. My pet showstopper used to be the lack of support for underbrace, which I find very useful in a teaching context at least, but that's supported too now. That said, I was unaware of the formal relationship between StackOverflow and Mathjax. Sounds like I am wasting my breath here indeed! $\endgroup$ – user154997 Sep 15 '17 at 10:39
  • $\begingroup$ @Luc Well, that doesn't mean it can't be tested user-side. $\endgroup$ – Emilio Pisanty Sep 15 '17 at 23:41
1
$\begingroup$

So I investigated KaTeX a bit and there is definitively a showstopper for me: there is not support for \newcommand. It is possible to define macros in the javascript code but it is not possible to write something like

$$\newcommand{\ket}[1]{|{#1}\rangle}\ket{\psi}$$

to give

$$\newcommand{\ket}[1]{|{#1}\rangle}\ket{\psi}$$

and I would find that very annoying as it is a great help to write complex answers.

$\endgroup$
  • $\begingroup$ It's not just a great help to write answers, it is needed to correctly display a nontrivial number of existing posts (with your name on several of them, of course =P). Backwards compatibility is essential for any site-wide changes. $\endgroup$ – Emilio Pisanty Oct 11 '17 at 11:05
  • $\begingroup$ Yes, it goes without saying. $\endgroup$ – user154997 Oct 11 '17 at 11:09

You must log in to answer this question.