Open pacien opened 10 years ago
thumb up!
yes, I found LaTeX is hard to write and learn ,while ASCIIMath allow us to use a simple calculator-style syntax to write math formulas on webpages, so it makes sense to add this feature!!!
pls add asciimath
I have just tried the homesite demo, and looks very "asciidoc/markdown" like. Could be a good feature.
MathJax is good, but asciiMath
is simple and covers many common scenarios, I would suggest to allow both, using the Extensions tab in the Options.
Just to make a point, see the difference between TeX and asciiMath with these examples:
\[ \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \]
(sum_(k=1)^n a_kb_k)^2 <= (sum_(k=1)^n a_k^2) (sum_(k=1)^n b_k^2)
\dot{x} = \sigma(y-x) \\ \dot{y} = \rho x - y - xz \\ \dot{z} = -\beta z + xy
dotx = sigma(y-x)
\doty = rho x-y - xz
\dotz = -beta z + xy
\[P(E) = {n \choose k} p^k (1-p)^{ n-k } \]
P(E) = ((n),(k)) p^k (1-p)^(n-k)
-b \pm \sqrt{b^2 - 4ac} \over 2a
x=-b+- sqrt(b^2-4ac)/2a
Some more examples comparing the same formulas in Markdown Plus help:
Núm. | LaTeX | length | ASCII Math | length |
---|---|---|---|---|
1 | \dfrac{ \tfrac{1}{2}[1-(\tfrac{1}{2})^n] }{ 1-\tfrac{1}{2} } = s_n |
66 | (1/2[1-(1/2)^n])/(1-(1/2))=8_n |
30 |
2 | \oint_C x^3\, dx + 4y^2\, dy |
28 | oint_Cx^3 dx+4y^2 dy |
21 |
3 | 2 = \left( \frac{\left(3-x\right) \times 2}{3-x} \right) |
57 | 2=(((3-x)xx2)/(3-x)) |
20 |
4 | \sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n} {3^m\left(m\,3^n+n\,3^m\right)} |
80 | sum_(m=1)^oosum_(n=1)^oo(m^2 n)/(3^m(m3^n+n3^m) |
48 |
And the last one is so big (169 characters), I must put it as a code block...
phi_n(\kappa) =
\frac{1}{4\pi^2\kappa^2} \int_0^\infty
\frac{\sin(\kappa R)}{\kappa R}
\frac{\partial}{\partial R}
\left[R^2\frac{\partial D_n(R)}{\partial R}\right]\,dR
And, ASCIImath version:
phi_n(kappa) = 1/(4pi^2 kappa^2)
int_0^oo (sin(kappa R))/(kappa R)
del/(del R)
[R^2 (del D_n (R))/(del R)] del R
Its not so long (112 characters, including spaces, I could've put it in a oneliner:
phi_n(kappa) = 1/(4pi^2 kappa^2) int_0^oo (sin(kappa R))/(kappa R) del/(del R) [R^2 (del D_n (R))/(del R)] del R
See the difference? And there's another one: I had only peeked at the docs to see he "name" of the 'oint'. Everything else I was able to type without help, it's "natural" (something LaTeX is definetly not ;)).
Possible convert AsciiMath to MathML, or not?
AFAIK stackedit already usses MathJax, which supports ASCIIMath.. I would like to know how to alter the configuration of the mathjax plugin (it's already in the config section) to switch to asciimath.
Unfortunately, StackEdit appears to no longer use MathJax, instead favoring KaTeX.
There is a preprocessor which is referenced from the official doc that converts ASCIIMath to LaTeX, such that it would still be fed through KaTeX.
Maybe that would be a viable option: Adding a StackEdit flag for enabling ASCIIMath and then, when extracting the LaTeX to pass it to KaTeX, intercepting with the prepocessor conditionally according to the flag.
MathJax already supports AsciiMath (http://docs.mathjax.org/en/latest/asciimath.html). It would be cool to add an option to enable it, in addition to LaTeX expressions (in the same time or with other delimiters).