topical media & game development

talk show tell print

sample-js-mathml.cfg / cfg



  <script> function page() { display(); } </script>
  
  

script(s)


  
  <slide id=sample-math-ml>
  <script> function slide() { display(); } </script>
  <script type="text/javascript" src="sample-js-mathml.js"></script>
  <script type="text/javascript">
  translateOnLoad=false;
  function display() {
    var str = document.getElementById("inputText").value;
    var outnode = document.getElementById("outputNode");
    var n = outnode.childNodes.length;
    for (var i=0; i<n; i++)
      outnode.removeChild(outnode.firstChild);
    outnode.appendChild(document.createTextNode(str));
    AMprocessNode(outnode);
  }
  </script>
  
  

type & display


  <center>
  <table border=1>
  <tr><td>
  <form>
  <textarea id="inputText" rows="10" cols="50" onkeyup="display()">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)
  
  </textarea>
  </form>
  
  <td width=400 bgcolor=white>
  <div style="color: black;" id="outputNode">
  
  </div>
  </td>
  <//tr></table>
  </center>
  <navigate/>
  
</slide>

explain


  <slide id=sample-js-mathml-explain>
  

explanation(s)

This page requires Internet Explorer 6+<a href="http://www.dessci.com/en/products/mathplayer">MathPlayer</a> or Mozilla/Firefox/Netscape 7+. <p> 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). The "amath" token switches on the new auto-math-recognize mode.</p> <navigate/> </slide>

note(s)


  <slide id=sample-js-mathml-notes>
  <p>
  <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.
  </p>
  </center>
  <navigate/>
  </slide>
  

code(s)


  <slide id=sample-js-mathml-codes>
  (Copy and paste the following lines to see what symbols they produce)<br>
  <b>You can use the following ASCIIMathML constructs:</b> 
  <br><tt> `(x+1)/(x-1) x^(i+j) x_(ij) sqrt(x) root(n)(x) stackrel(+)(-&gt;) 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;= &gt; &gt;= -&lt; &gt;- in !in sub sup sube supe -= ~= ~~ prop`</tt>
  <br><b>Logical symbols</b><tt> `\and \or \not =&gt; if iff AA EE _|_ TT |-- |==`</tt>
  <break/>
  <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>
  <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> 
  <br><b>Arrows</b><tt> `uarr darr rarr -&gt; larr harr rArr lArr hArr` </tt><br>
  <break/>
  <br><b>Accents</b><tt> `hatx barx ulx vecx dotx ddotx` </tt>
  <br><b>Font commands</b><tt> `bbA bbbA ccA ttA frA sfA` </tt>
  <br><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> 
  <navigate/>
  </slide>
  

conclusion(s)


  
  <slide id=sample-js-mathml-conclude>
  <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>
  <navigate/>
  </slide>
  

author


  <slide id=sample-js-math-ml-author>
  
  <h4>
  author: http://www1.chapman.edu/~jipsen
  >
  

</a>, <a href="http://www.chapman.edu/">Chapman University</a>, September 2007 </div> </body></html>

(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.
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2780434-1"; urchinTracker(); </script>