|
Mathematical formulas can be added to Wiki pages with the help of ASCIIMathML. |
Installation on client side
To make ASCIIMathML work you (as a client) should install
for Internet Explorer: MathPlayer - Without MathPlayer formulas are not displayed in rendered form.
for Firefox/Mozilla: MIT MathML-Fonts; without these fonts some formulas are not correctly displayed.
Simple Example
Let's test the ASCIIMathML.js translator on a simple example: Solving the quadratic equation.
Suppose $$ ax2+bx+c=0 $$ and $$ a!=0 $$. We first divide by $$a$$ to get $$ x2+b/ax+c/a=0 $$. Then we complete the square and obtain $$ x2+b/ax+(b/(2a))2-(b/(2a))2+c/a=0 $$. The first three terms factor to give $$ (x+b/(2a))2=(b2)/(4a2)-c/a $$. Now we take square roots on both sides and get $$ x+b/(2a)=+-sqrt((b2)/(4a2)-c/a)$$. Finally we move the $$ b/(2a) $$ to the right and simplify to get the two solutions:
- $$ x_(1,2)=(-b+-sqrt(b^2 - 4ac))/(2a) $$
Here is the text that was typed in:
Suppose $$ ax^2+bx+c=0 $$ and $$ a!=0 $$. We first divide by $$a$$ to get $$ x^2+b/ax+c/a=0 $$. Then we complete the square and obtain $$ x^2+b/ax+(b/(2a))^2-(b/(2a))^2+c/a=0 $$. The first three terms factor to give $$ (x+b/(2a))^2=(b^2)/(4a^2)-c/a $$. Now we take square roots on both sides and get $$ x+b/(2a)=+-sqrt((b^2)/(4a^2)-c/a)$$. Finally we move the $$ b/(2a) $$ to the right and simplify to get the two solutions: $$ x_(1,2)=(-b+-sqrt(b^2 - 4ac))/(2a) $$
More examples
The syntax reference of ASCIIMathML can be found here:
ASCIIMath-Syntax from ASCIImathML web site.
This page can be used for almost WYSWYG editing of formulae to be copy-pasted to your wiki page (note that there you have to use single dollar sign or back quote instead of double dollar sign).
If you are familiar with MathML, you might appreciate that this ASCII input form is less verbose and more readable. If you are familiar with TeX, this is still somewhat less cluttered. The aim is to have input notation that is close to graphing calculator notation, so that students are able to use it on webpages and in emails without having to learn another specialized syntax.
Type this |
See that |
Comment |
$$ x^2+y_1+z_12^34 $$ |
$$ x2+y_1+z_1234 $$ |
subscripts as in TeX, but numbers are treated as a unit |
$$ sin^-1(x) $$ |
$$ sin^-1(x) $$ |
function names are treated as constants |
$$ d/dxf(x)=lim_(h->0)(f(x+h)-f(x))/h $$ |
$$ d/dxf(x)=lim_(h->0)(f(x+h)-f(x))/h $$ |
complex subscripts are bracketed, displayed under lim |
$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$ |
$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$ |
standard LaTeX notation is an alternative |
$$f(x)=sum_(n=0)^oo(f^((n))(a))/(n!)(x-a)^n$$ |
$$ f(x)=sum_(n=0)oo(f((n))(a))/(n!)(x-a)n $$ || `f((n))(a) must be bracketed, else the numerator is only a` |
|
$$ $f(x)=\sum_{n=0}^\infty\frac{f^{(n)}(a)}{n!}(x-a)^n $$ |
$$ f(x)=\sum_{n=0}\infty\frac{f{(n)}(a)}{n!}(x-a)^n $$ |
standard LaTeX produces the same result |
$$ int_0^1f(x)dx $$ |
$$ int_0^1f(x)dx $$ |
subscripts must come before superscripts |
$$ [[a,b],[c,d]]((n),(k)) $$ |
$$ a,b],[c,d((n),(k)) $$ |
matrices and column vectors are simple to type |
$$ x/x={(1,if x!=0),(text{undefined},if x=0):} $$ |
$$ x/x={(1,if x!=0),(text{undefined},if x=0):} $$ |
piecewise defined function are based on matrix notation |
$$ a//b $$ |
$$ a//b $$ |
use // for inline fractions |
$$ (a/b)/(c/d) $$ |
$$ (a/b)/(c/d) $$ |
with brackets, multiple fraction work as expected |
$$ a/b/c/d $$ |
$$ a/b/c/d $$ |
without brackets the parser chooses this particular expression |
$$ ((a*b))/c $$ |
$$ ((a*b))/c $$ |
only one level of brackets is removed; * gives standard product |
$$ sqrtsqrtroot3x $$ |
$$ sqrtsqrtroot3x $$ |
spaces are optional, only serve to split strings that should not match |
$$ (:a,b:) and {:(x,y),(u,v):} $$ |
$$ (:a,b:) and {:(x,y),(u,v):} $$ |
angle brackets and invisible brackets |
$$ (a,b]={x in RR : a < x <= b} $$ |
$$ (a,b]={x in RR : a < x <= b} $$ |
grouping brackets don't have to match |
$$ abc-123.45^-1.1 $$ |
$$ abc-123.45^-1.1 $$ |
non-tokens are split into single characters,<br/>but decimal numbers are parsed with possible sign |
$$ hat(ab) bar(xy) ulA vec v dotx ddot y $$ |
$$ hat(ab) bar(xy) ulA vec v dotx ddot y $$ |
accents can be used on any expression (work well in IE) |
$$ bb{AB3}.bbb(AB].cc(AB).fr{AB}.tt[AB].sf(AB)\ $$ |
$$ bb{AB3}.bbb(AB].cc(AB).fr{AB}.tt[AB].sf(AB) $$ |
font commands; can use any brackets around argument |
$$ stackrel"def"= or \stackrel{\Delta}{=}" "("or ":=) $$ |
$$ stackrel"def"= or \stackrel{\Delta}{=}" "("or ":=) $$ |
symbols can be stacked |
$$ {::}_(\ 92)^238U $$ |
$$ {::}_(\ 92)^238U $$ |
prescripts simulated by subsuperscripts |