<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="pmathml.xsl"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ASCIIMathML.js demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="ASCIIMathML.js"></script>
<script type="text/javascript" src="ASCIIMathMLdisplay.js"></script>
<style type="text/css">
#menu, #title, #subtitle, #author {text-align: center}
</style>
</head>
<body onload="display()">

<div id="menu">
| <a href="asciimath.xml">Home Page</a> |
<a href="asciimathsyntax.xml">Syntax</a> |
Try it |
<a href="asciimathcalculator.html">Calculator</a> |
<a href="asciimatheditor.xml">Editor</a> |
<a href="asciimathdownload.xml">Download</a> |
<a href="http://math.chapman.edu/cgi-bin/mathxml.pl?ASCIIMath_FAQ">ASCIIMath FAQ</a> |
<a href="http://math.chapman.edu/cgi-bin/mathxml.pl?ASCIIMath_Sandbox">Sandbox</a> |
<a href="http://math.chapman.edu/cgi-bin/mathxml.pl?ASCIIMath_Comments_and_Suggestions">Comments</a> |
<a href="http://www.chapman.edu/~jipsen/asciisvg.html">ASCIIsvg</a> |
</div>

<hr/>

<h2 id="title">
ASCIIMathML.js: Try it yourself
</h2>

<center>
<b>
This page requires Internet Explorer 6+<a 
href="http://www.dessci.com/en/products/mathplayer">MathPlayer</a> 
or Mozilla/Firefox/Netscape 7+.
</b>
<p>
Edit the formulas below (the display updates dynamically).
If you know (La)TeX formula syntax, you can try some of that as well
(most basic formulas work; can use \$-signs instead of left-quote).
</p>

<form action="">
<textarea id="inputText" rows="10" cols="80" onkeyup="display()">
Let's try some interesting formulas: `E=mc^2`
and
`e^(ipi)=-1`
and
$AA x in CC (sin^2x+cos^2x=1)$
and one more:
`sum_(i=1)^ni^3=((n(n+1))/2)^2`


</textarea>
</form>

<p/>

<div id="outputNode"></div>

<hr/>

<b>Note that this is dynamic XHTML running locally on your machine!</b>
<br/>
Right-click on an output formula to copy or view the MathML code.
</center>
<p>
(Copy and paste the following lines to see what symbols they produce)<br/>
<b>You can use the following ASCIIMathML constructs:</b> 
<tt> \`(x+1)/(x-1) x^(i+j) x_(ij) sqrt(x) root(n)(x) stackrel(+)(->) text(any) "any"\`</tt><br/>
<b>Operation symbols</b> 
<tt> \`+ - * ** // \\ xx -: @ o+ ox sum prod ^^ ^^^ vv vvv nn nnn uu uuu\`</tt><br/>
<b>Relation symbols</b>
<tt> \`= != &lt; &lt;= > >= -&lt; >- in !in sub sup sube supe -= ~= ~~ prop\`</tt><br/>
<b>Logical symbols</b><tt> \`and or not => if iff AA EE _|_ TT |-- |==\`</tt><br/>
<b>Miscellaneous symbols</b> 
<tt> \`int oint del grad +- O/ oo aleph ... cdots \  quad qquad diamond square |__ __| |~ ~| CC NN QQ RR ZZ\`</tt><br/>
<b>Standard functions</b> 
<tt> \`sin cos tan csc sec cot sinh cosh tanh log ln det dim lim mod gcd lcm\`</tt><br/>
<b>Grouping brackets</b><tt> \`( ) [ ] { } (: :) {: :}\` </tt> 
<b>Arrows</b><tt> \`uarr darr rarr -> larr harr rArr lArr hArr\` </tt><br/>
<b>Accents</b><tt> \`hatx barx ulx vecx dotx ddotx\` </tt>
<b>Font commands</b><tt> \`bbA bbbA ccA ttA frA sfA\` </tt>
<b>Matrices</b><tt> \`[[a,b],[c,d]] ((1,0),(0,1))\` </tt><br/>
<b>Greek letters</b><tt> \`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\`</tt> 
</p>

<p>
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 <b><a
href="http://math.chapman.edu/email/">write and read
mathematical emails and discussion group articles</a></b>. 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.
</p>

<p>
If you want your examples to be saved so others can look at them,
consider editing the ASCIIMath Wikiserver 
<a href="http://math.chapman.edu/cgi-bin/mathxml.pl?ASCIIMath_Sandbox">Sandbox</a>
</p>

<hr/>
<div id="author">
<a href="http://www.chapman.edu/~jipsen/">Peter Jipsen</a>, 
<a href="http://www.chapman.edu/">Chapman University</a>, August 2005

<a href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww1.chapman.edu%2F~jipsen%2Fmathml%2Fasciimathdemo.xml"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
</div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2263958-1";
urchinTracker();
</script>
</body>
</html>
