attempt at CodeMirror + in-place MathJax [
source on github
]
MathJax version:
2.3.0
2.4.0
2.5.3
2.6.1
2.7.1
| CodeMirror version:
3.24.0
4.8.0
4.13.0
5.0.0
5.11.0
5.26.0
(for any other versions edit URL params)
Loading...
**To edit formulas, move cursor into them with arrow keys.** Clicking with mouse should work but currently doesn't :-(. # Inline math $a<b>c$ > xXxXxXxXxXxXxXxXxXxXxXxX Normal-size line with $n = 2$ compact formulas: $x*y$. There was a `*` in that formula but this text should not be italic. xXxXxXxXxXxXxXxXxXxXxXxX >> Foo \(\sum^{y}_{z} \frac{1}{x}\) bar. xXxXxXxXxXxXxXxXxXxXxXxX ## Misc MathJax extensions AMScd: $ \begin{CD} A @<<< B @>>> C\\ @. @| @AAA\\ @. D @= E \end{CD}$ cancel: $ \cancelto{\cot}{\tan} \frac{A \bcancel{B}}{\bcancel{B} C} $ mhchem: \( \ce{$A$ ->[\ce{+H2O}] $B$} \) *et cetera...* (No thanks to this library, I simply enabled them in [MathJax config](http://docs.mathjax.org/en/latest/tex.html).) # Display math The following `...xXx formula xXx...` are written on one line but the formula is displayed separately. > xXxXxXxXxXxXxXxXxXxXxXxX $$\sum^b_c \frac{1}{a}$$ xXxXxXxXxXxXxXxXxXxXxXxX ## Maxwell's Equations \begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} # Numbering — quite broken This demo has `autoNumber: "AMS"` in [MathJax config](http://docs.mathjax.org/en/latest/options/TeX.html), so `\begin{equation}` works at first glance — but it's pretty broken: $$\sum^b_c \frac{1}{a}$$ > BUG: numbering is unusable, increments with every edit. This is a forward reference [\ref{ref2}] and another \eqref{ref2} for the following equation: \begin{equation}x+1\over\sqrt{1-x^2}\label{ref2}\end{equation} This is a back reference [\ref{ref2}] and another \eqref{ref2} for the preceding equation. (can also put `[eq]ref` inside math: $\ref{ref2} \Rightarrow \eqref{ref2}$.) > BUG: labels are completely broken, result in error second time equation is typeset! \begin{align} x& = y_1-y_2+y_3-y_5+y_8-\dots && \text{by \eqref{ref1}}\\ & = y'\circ y^* && \text{(by \eqref{ref3})}\\ & = y(0) y' && \text {by Axiom 1.} \end{align} # Defining macros Define \foo: \newcommand{\foo}{f_0^0} Use \foo: $\foo$ > BUG: definition changes don't trigger re-typesetting, but it's rare enough that refreshing the page is acceptable workaround. # In monospace xXxXxXxXxXxXxXxXxXxXxXxX >> Foo \(\sum^y_z \frac{1}{x}\) bar. xXxXxXxXxXxXxXxXxXxXxXxX $$\sum^b_c \frac{1}{a}$$ xXxXxXxXxXxXxXxXxXxXxXxX --------------------------------------------------------------------------------