topical media & game development

#### www1.chapman.edu/~jipsen/mathml/asciimath.html / tutorial(s) / SVG / S5 / source(s) / cfg / []

 amath Let's try some interesting formulas: E=m c^2 and e^(i pi)=-1 and AA x in CC (sin^2x+cos^2x=1) and one more: sum_(i=1)^n i^3=((n(n+1))/2)^2 (add your own -- note that text-tokens are only recognized if separated by spaces)

#### explanation(s)

Edit the formulas above (the display updates dynamically). If you know (La)TeX formula syntax, you can try some of that as well (LaTeX formulas work best when enclosed in $-signs\right). The "amath" token switches on the new auto-math-recognize mode.$

##### document.write(' <a href=');if (!slidemode) { document.write('@slide-'); } else { document.write('sample-js-mathml.html#slide-'); } document.write('sample-js-mathml-explain'); if (!slidemode) document.write('.html');document.write('>'); Note that this is dynamic XHTML running locally on your machine!
Right-click on an output formula to copy or view the MathML code.

##### document.write(' <a href=');if (!slidemode) { document.write('@slide-'); } else { document.write('sample-js-mathml.html#slide-'); } document.write('sample-js-mathml-notes'); if (!slidemode) document.write('.html');document.write('>'); (Copy and paste the following lines to see what symbols they produce)
You can use the following ASCIIMathML constructs:
`(x+1)/(x-1) x^(i+j) x_(ij) sqrt(x) root(n)(x) stackrel(+)(->) text(any) "any"`
Operation symbols `+ - * ** // \\ xx -: @ o+ ox sum prod ^^ ^^^ vv vvv nn nnn uu uuu`
Relation symbols `= != < <= > >= -< >- in !in sub sup sube supe -= ~= ~~ prop`
Logical symbols `\and \or \not => if iff AA EE _|_ TT |-- |==`
Miscellaneous symbols `int oint del grad +- O/ oo aleph ... cdots \ quad qquad diamond square |__ __| |~ ~| CC NN QQ RR ZZ`

Standard functions `sin cos tan csc sec cot sinh cosh tanh log ln det dim lim mod gcd lcm`
Grouping brackets `( ) [ ] { } (: :) {: :}`
Arrows `uarr darr rarr -> larr harr rArr lArr hArr`

Accents `hatx barx ulx vecx dotx ddotx`
Font commands `bbA bbbA ccA ttA frA sfA`
Matrices `[[a,b],[c,d]] ((1,0),(0,1))`
Greek letters `alpha beta chi delta Delta epsi eta gamma Gamma iota kappa lambda Lambda mu nu omega Omega phi Phi pi Pi psi rho sigma Sigma tau theta Theta upsilon xi Xi zeta`
##### document.write(' <a href=');if (!slidemode) { document.write('@slide-'); } else { document.write('sample-js-mathml.html#slide-'); } document.write('sample-js-mathml-codes'); if (!slidemode) document.write('.html');document.write('>'); This demo page shows that ASCIIMathML.js can be used easily to dynamically preview mathematical formulas (client-side). E.g. here is a (beta) webpage that can be used to write and read mathematical emails and discussion group articles. Since most email communication is still done with ASCII text (or at least not yet with XHTML), this is a reasonable (and inexpensive) solution for communicating with students in online math courses.

#### author: www1.chapman.edu/~jipsen

Peter Jipsen, Chapman University, September 2007

(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.