A small, but in my opinion significant, percentage of programming questions (not math questions that'd belong on https://math.stackexchange.com/) and some of their answers require mathematical formulas.
Some mathematical formulas are nearly incomprehensible when approximated in ASCII plain text. Some authors instead use LaTeX code blocks in their posts, but not every one knows how to read those:
$\sigma(M)^2 = \frac{1}{2(M-1)} \sum_{i=1}^{M-1} [y_{i+1}-y_{i}]^2$
(The example is from here.)
Some simple formulas can be approximated by HTML with <sub>
, <sup>
, ∑
etc. The closest I achieved for the above was
σ(M)<sup> 2</sup> = <sup>1</sup>/<sub>2 (M−1)</sub> ∑<sub>i=1</sub><sup>M−1</sup> [y<sub>i+1</sub> − y<sub>i</sub>]<sup> 2</sup>
to get
σ(M) 2 = 1/2 (M−1) ∑i=1M−1 [yi+1 − yi] 2
But this can only be taken so far. As soon as matrices or vectors with their components are involved (which can happen for programming questions that do not belong on https://math.stackexchange.com/), this approach breaks down.
Other than on some other Stack Exchange sites, I guess we won't get MathJax on Stack Overflow because it would be a change that could break existing content unless it was strictly opt-in (e.g. with hint comments) and also for performance reasons.
But would it be possible to simply allow posts (at least questions and answers, maybe also comments and tag wikis) to contain MathML markup? For browsers that don't yet support it, one of the available polyfills could be used. If client-side performance is of concern, the polyfill could only be referenced when the Stack Overflow server detects the string <math>
in the content (which shouldn't affect server-side performance too much, I think).
$formula_A
, I've written$code_snippet_B
. However, while according to my manual calculation,$formula_A
gives result$D
for input$C
,$code_snipped_B
's output for$C
is$E
. I suspect that$language_F
's foo-operator differs from the mathematical foo notion, but can't find any hint toward that in the documentation."