<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://math.chapman.edu/~jipsen/mathml/pmathml.xsl"?>
<!DOCTYPE html SYSTEM "http://math.chapman.edu/~jipsen/mathml/mathml.dtd" [
  <!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
]>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapman Math: ASCIIMath Comments and Suggestions</title>
<script type="text/javascript" src="http://www1.chapman.edu/~jipsen/mathml/ASCIIMathML.js"></script>
<script type="text/javascript" src="http://math.chapman.edu/~jipsen/TP/TextPuzzles3.js"></script>
<script type="text/javascript" src="http://www1.chapman.edu/~jipsen/svg/ASCIIsvg.js"></script>
<style type="text/css">
a {cursor: pointer; cursor: hand;}
</style>
<link rel="stylesheet" href="/wiki.css"></link>
</head><body bgcolor="white" onload="translate();initPuzzlePieces();if (window.drawPicture!=null) drawPicture()">
<h1><a href="mathxml.pl?search=ASCIIMath+Comments+and+Suggestions">ASCIIMath Comments and Suggestions</a></h1><a href="mathxml.pl?HomePage">HomePage</a> | <a href="mathxml.pl?RecentChanges">RecentChanges</a> | <a href="mathxml.pl?action=editprefs">Preferences</a><br></br>
<hr></hr><h3>Add your comments on this page by clicking on the "Preferences" link above, then choose a username and enter "comments" in the Set password box and click the save button, then return to this page (reload) and click "Edit text of this page" below (sorry, this page was getting spammed too much)</h3>

<p></p>
WYSIWYG HTML editors like htmlArea and Xinha (htmlArea's offspring) are technically ready to use ASCIIMathML, but there is one slight licensing problem that prohibits distributing ASCIIMathML plugin with these wonderful editors. Your code is distributed under GPL license that is not compatible with htmlArea license. In particular, GPL-licensed product cannot be a part of a commercial product. htmlArea license allows this. That's why we can't make ASCIIMathML an integral part of the editor.
<p></p>
I think that distribution of ASCIIMathML in package with popular HTML editors will only increase popularity and usefulness of ASCIIMathML. I think, you will agree that simplified usage of your plugin will only increase it's popularity without harming openness of the code in any way. Licensing ASCIIMathML under LGPL (Lesser GPL) will be enough to include it in the editors. LGPL is still a free and open license. Alternatively, you can make an exception for Xinha and htmlArea in your GPL license. Please, think about it.
We all hope that your decision will be positive. Best regards,
<p></p>
Alexey and all Xinha development team.
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
I am writing first to congratulate you for this amazing tool you developed. I don't know what my graduation work should be without AsciiMathML. Next, i'd like to say that your tool is being very imortant for me and my friends. We (a group of 6 people) are at our last year of Systems Information Bachelor graduation and for our final graduation work, we are developing a little system wich will generate classroom tests from a SQL database in a random way, using only HTML pages with ASP as end user interface. It is at this point that AsciiMathML helped us. We need to input the questions, as well as their answers,  to our database and some of them use formulas. We had a very hard time thinking what to do to build formulas and store them in the SQL but we finally found something that could help us and solve our problem! We are gonna graduate in early december and our system is hosted at one website for tests.It is not finished yet but if you'd like to have a look, you are welcome altought it is a very simple system. The only incovenient is that the system's interface is written in Portuguese language. (we are brazilians). Thank you very much for help! 
<p></p>
Richard Lima
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Your script is fantastic, and I would like to use it in my educational project.
But I encountered some difficulties with Xinha editor. It seems that this editor is in unstable version now, or maybe I am just a newbie. :-) Although, the editor here, on a page of your site works perfectly. Could you please make a package with your working Xinha editor and all necessary plugins? Please, place it on your site, or just e-mail it to me (alex.kir@plotinka.ru). Thanks in advance! Best regards,
<p></p>
Alexey, Ural State University
<p></p>
non-Peter reply:  Peter and I worked on modifying HTMLArea (another HTML editor) with ASCIIMathML and ASCIIsvg plugins.  There is a reasonably stable release at <a href="http://www.pierce.ctc.edu/dlippman/projects.html">http://www.pierce.ctc.edu/dlippman/projects.html</a> Perhaps this would fit your need.  - David Lippman
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Hi, I'm a student at Goettingen University and we plan to incorporate your tool in our student forum. It's just great. But first a few sugestions:
<p></p>
1) \_1^1H should work as `{::}_1^1H`.
<p></p>
2) R_i\^j\_k\_l\^n should work as `R_i{::}^j{::}_k{::}_l{::}^n`. This seems to be very useful for tensors.
<p></p>
3) a =\M1\= b should work as `a stackrel("M1")(=) b`
<p></p>
4) a =\M1\=&gt; b should work as `a stackrel("M1")(=&gt;) b`
<p></p>
5) a -\M1\-&gt; b should work as `a stackrel("M1")(-&gt;) b`
<p></p>
Is it possible to place text not above, but below the relation? If it is, that would be nice to have =/Text/= placing Text below the sign. Is it possible to make signs (=, =&gt;, -&gt;) wider, when they are used in stackrel?
<p></p>
Few tips for ASCII-editor:
<p></p>
1) The text is much more readable (at least for my eyes) if you use Arial Narrow instead of Courier New in edit field.
<p></p>
2) I think, \$ or \` are not the optimal solution for denoting math insertions. 
Something like {{a}} or {{sum_(i = 0)^n i = (n(n + 1))/2}} isn't much harder to type, but looks much better, since ending and beginning of math insertion are visible at glance. That's not only my opinon, I've already tested it on my mates in the University. :-)
<p></p>
3) There is no way to insert a &lt;br&gt; in your editor. Could you translate slashes in the ending of line to &lt;br&gt;s?
Just like /
this.
<p></p>
4) If a line beginns with \$, it's whole content should be treated as math insertion. It's quite useful as well.
<p></p>
5) I don't really know how to do it, but it will be very useful if<pre>
$ a + b = c^2
$   = d
</pre>
<p></p>
Would render similar to:
<p></p>
`{:(a + b,=,c^2),(,=,d):}`
<p></p>
Upd: Eqnarray syntax?<pre>
$ a + b &amp;=&amp; c^2
$   &amp;=&amp; d
</pre>
<p></p>
- Alex
<p></p>
A: Thanks for the suggestions. Some of them may be implemented in a future version. The quickest way may be if you simply try to modify the script to implement them yourself. E.g. the stackrel command uses the MathML mover tag, and copying this code and modifying it to munder will allow placing the label below the arrow symbol. Making the arrows longer, or implementing the nice syntax for annotated arrows would be a bit more work. The delimiters for math can be customized by editing the AMdelimiter variables at the beginning of the script (currently the start and end symbol have to be the same, but again this is not difficult to change).
<p></p>
Syntax for equation alignment would be useful. I have tried to keep the ASCIIMathML script and the language features to a minimum so that it remains efficient and easy to learn, but for specific applications users should feel free to expand it (and please let me know of interesting developments). Best wishes with your students forum. - Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: How do I get a subscript in front of an expression like `._4C_3(2!)^3` but with out the period.  I added the period because this is the only way I could get it to work.  Thank you.
<p></p>
A: You can use {::} (invisible brackets) instead of the period. E.g. `{::}_4C_3(2!)^3` -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: ASCIIMath failed to interpret $e^{-\frac{1}{2}(\frac{d}{\sigma})^{2}}$ and `e^((-1/2)(d/sigma)^2)`. Is it a bug ?
<p></p>
A: Works for me on Windows XP with IE6+MathPlayer. What system/browser is it failing on? -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: Sorry but my English is very poor :-( Suggestion: Add this code at the end of ASCIMathML.js.
<p></p>
<pre>
function translateById(objId) {
  AMbody = document.getElementById(objId);
  AMprocessNode(AMbody, false);
  if (isIE) { //needed to match size and font of formula to surrounding text
    var frag = document.getElementsByTagName('math');
    for (var i=0;i&lt;frag.length;i++) frag[i].update()
  }
}

AMinitSymbols();
</pre>
<p></p>
and, example.
<p></p>
<pre>
&lt;p&gt;
Remember to surround formulas with left-quotes or \$-signs: 
`sum_(i=1)^n i=(n(n+1))/2` and $int_0^(pi/2) sinx\ dx=1$.
&lt;/p&gt;

&lt;p id="test1"&gt;
Remember to surround formulas with left-quotes or \$-signs: 
`sum_(i=1)^n i=(n(n+1))/2` and $int_0^(pi/2) sinx\ dx=1$.
&lt;/p&gt;
&lt;script type="text/javascript"&gt;translateById('test1');&lt;/script&gt;

&lt;p&gt;
Remember to surround formulas with left-quotes or \$-signs: 
`sum_(i=1)^n i=(n(n+1))/2` and $int_0^(pi/2) sinx\ dx=1$.
&lt;/p&gt;

&lt;p id="test2"&gt;
Remember to surround formulas with left-quotes or \$-signs: 
`sum_(i=1)^n i=(n(n+1))/2` and $int_0^(pi/2) sinx\ dx=1$.
&lt;/p&gt;
&lt;script type="text/javascript"&gt;translateById('test2');&lt;/script&gt;
</pre>
<p></p>
What do you think about it? I think, user can choose the range of convert.
<p></p>
A: This is a good idea. I may include it in the next version as an option. (Originally I just wanted to make it very simple to use ASCIIMathML, but for some applications this extra control you are suggesting will be useful.) Thanks, Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: Just wondering if I could change the way i input the code? like for example i would like to use [math]AA x in bbbN. 4 &lt; x ^^ x &lt; 6 =&gt; x = 5[/math] or something instead of the \$ signs
<p></p>
A: This is possible, but requires some minor changes in your local ASCIIMathML.js file. E.g. you could replace the line
<pre>
      str = str.replace(/\$/g,"`");
</pre>
in the function AMprocessNode (line 716 in version 1.4) with the lines
<pre>
      str = str.replace(/\[math\]/g,"`");
      str = str.replace(/\[\/math\]/g,"`");
</pre>
(Beware, this "quick fix" allows incorrect syntax such as [math]x^2[math].) -- Peter
<p></p>
Q: Thank you so much! Ok, now, the [math] etc stuff converts and also the \$ signs stay. And about the syntax "problem" with [math]x^2[math] doesn't matter. Now my only "wish" is to eliminate the \` signs so that ONLY [math] tags work. I see you Programmed everything around the \` signs. Will it work, when i just replace all \` signs with "[math]" ?
<p></p>
A: Yes, that should work. (You could also use &lt; math&gt; ... &lt; /math&gt; and let the browser parse the tags. This is perhaps more efficient and also more in line with the (X)HTML philosophy, but it requires some browser-dependent code similar to how <a href="http://www1.chapman.edu/~jipsen/mathml/mathhtmltest.phtml">http://www1.chapman.edu/~jipsen/mathml/mathhtmltest.phtml</a> works.)
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: Hi! I think ASCIIMath is great and I would like to implement a PHP version of it to actually generate the MathML from the server side. Hope you don't mind, but I may bug you with questions (kc56@cornell.edu)
<p></p>
A: I certainly don't mind. In fact I encourage this, and have even suggested it as a project to others (but I'm not aware of anyone working on it). I'll be happy to answer any questions, and I hope you can come up with better algorithms than I did for tokenizing the input string. Generating the MathML will be a bit easier since you can just work with producing the string rather than building the DOM tree. 
<p></p>
If you manage to emulate the (current) ASCIIMathML syntax exactly (or very closely), I encourage you to call your script ASCIIMathML.php and to release it under GPL or LGPL. -- Thanks, Peter
<p></p>
<strong>Update:</strong> see <a href="http://www.jcphysics.com/ASCIIMath/">http://www.jcphysics.com/ASCIIMath/</a> to try out or download the ported ASCIIMathPHP script.
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: Could it be included in mozillas mail program, for writing email?
<p></p>
A: This seems like a nice idea. In principle, yes, but do I know how to do it? Not at this stage. Perhaps someone familiar with modifying Netscape can help. In fact, Netscape does seem to have some minimal builtin formula recognition ability: typing x^2 produces a readable superscript in the received mail. -- Peter
<p></p>
Netscape/Mozilla use an *internal* interface named mozITXTToHTMLConv to achieve this; you'd need to hack the C++ core to extend that. A JS solution should be possible, but not very easy to achieve. /Mnyromyr/
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: I think there is something to do with lt and gt : these symbols are quite used in mathematic world and are accessible with the keyboard. Is it possible to add a function to your script that would change (just before the processing) &lt; &gt; to lt and gt so that the user don't have to manage with lt and gt ?
<p></p>
A: This is a valid concern. It is difficult (and probably undesirable) to change the way XML is parsed. The '&lt;' character is special and cannot be used for anything other than XML tags. However one can put ASCIIMathML statements inside XML comments (using &lt;!-- ... --&gt;) and in this case it is legal to use &lt;, &gt; rather than lt, gt. Check the sample file on the download page for an example of this. I hope this is a reasonable solution for your question. Inside the comment, however, any XML tags are not parsed, so formating has to be done outside the comment. -- Peter
<p></p>
<strong>Update:</strong> I discovered that ASCIIMathML also works with HTML files (see <a href="http://www.chapman.edu/~jipsen/mathml/asciimath.html">http://www.chapman.edu/~jipsen/mathml/asciimath.html</a> ). In this case the '&lt;' character can be used without problem. (For IE it was always clear that (ASCII)MathML works with HTML files, but for Netscape7/Mozilla/Firefox, MathML is restricted to XHTML files, whereas the dynamic features of ASCIIMathML apparently circumvent this restriction.) -- Peter 2004.3.13
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: Missing some features needed for chemical reactions?
1) Stacked symbols: Description directly above or below reaction arrows, and stacked arrows in opposite directions. LaTeX does this automatically for larger symbols, like \sum or \lim, instead of sub or superscript.
2) Hard space: ~^{238}_{92}U isotopes.
<p></p>
A: Yes, stacking symbols (and overwriting symbols) are useful. (Negative space does not seem to work in Netscape/Mozilla/Firefox). Hardspace (using backslashblank) works right now, but for spacing reasons it is better to use invisible brackets: `{::}_(\ 92)^238U`. Note that the ASCIIMathML syntax requires subscripts before superscripts.
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: When I write something like min_x f(x) I end up with `min_x f(x)` when what I want is "min". How can I include that? Maybe an idea is to say that the commands like in sqrt must be separated by spaces of the other symbols so we write \\$sqrt x\\$ instead of \\$sqrtx\\$. Just a thought. Thanks 
<p></p>
A: I have written in the file ASCIIMathML.js like as:
<p></p>
     {input:"min", tag:"mo", output:"min", underover:"true"},
<p></p>
You can see a sample on the page <a href="http://limit.ssu.ac.kr/asciimathExample.html">http://limit.ssu.ac.kr/asciimathExample.html</a> - Phk 
<p></p>
A2: \`text{min}\` is another solution to this problem. 
<p></p>
Changing the recognition of ASCIIMathML keywords so that they have to be separated by non-alphabetic characters is a reasonable suggestion. (Planned as an option in Version 1.3). However, \`min\` would still not be typeset correctly since by default it is a sequence of three mathvariables. This default behavior is unlikely to change in future versions.
<p></p>
As noted above, function names that are used often are perhaps best handled by extending the symbol table. This can also be done locally in the HTML file as in <a href="http://www1.chapman.edu/~jipsen/mathml/asciimathextend.html">http://www1.chapman.edu/~jipsen/mathml/asciimathextend.html</a> ). -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Hi. I love what you've done. I stuck the script inside movabletype to create a "math"blog. it is located at <a href="http://faculae.net">http://faculae.net</a> , please check it out.
There are two things I would like to be able to do. First, it would be nice if display() and translate() wouldnt "ruin" the html tags. It would be particularly nice to have line breaks and be able to insert &lt;a&gt; tags. Second, it would also be nice to have a translate() that just translated elements by id. Not sure how to do either of these just now. Any thoughts would be helpful (looks like you may have a script of this sort working on this page to mark up <a href="http://">http://</a>). Thanks.
James
<p></p>
A: translate() used on a webpage (or in a wikiserver like this one) respects the html tags and works only on the formulas between \`...\`. This is possible since the html is already parsed by the browser before translate() is invoked. However display() works dynamically on text created after the page finished loading, so it does not handle html tags. Originally ASCIIMathML.js was designed for xml pages, so there was no simple way to parse dynamic text. Since ASCIIMath now also works for HTML pages, one can use innerHTML to first parse this typed text into the browser DOM tree, and then process that part of the tree with translate(). Before I claim that this should be easy, I'll see if I can, in the near future, get it to work in the ASCIIMath Editor (HTML version).
<p></p>
Restricting translate to elements by id is a good idea. I'll put it on the list for version 1.4. I like what you did with the menu to enter math symbols from a palette. This certainly helps people to get started with ASCIIMathML. I haven't used Movabletype yet, so its good to see that ASCIIMathML works there as well. -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Hallo, thank's for the excellent tool. One question: Today it's only possible to have sub and sup on the right side of a symbol (with _ and ^). Is there any plan to support the tag "mprescripts" to make it possible to have sub and sup on the left side of a symbol?
- Greez Stefan
<p></p>
A: The "plan" is to merge ASCIIMathML with standard MathML syntax, so that all MathML constructs can be used within ASCIIMathML formulas when they are required. Prescripts would be nice, but finding an intuitive syntax that is as general as the MathML &lt;mmultiscripts&gt; syntax seems difficult. Hence the idea of just making that syntax available in such cases. There are still some problems that need to be worked out (e.g. ASCIIMathML.js should not become too large or get any slower) so this will probably take a while. A syntax like 92_:238^:U might be used for single prescripts, but would this be sufficient for most uses? -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: How can I get the logical symbols for &ldquo;and&rdquo; and &ldquo;or&rdquo; (/\ and \/) rather than the words?
<p></p>
A: The ASCIIMath names for these symbols are ^^ and vv: `^^`, `vv`. Alternatively one can use the LaTeX names \wedge and \vee. You could also define /\&nbsp;and \/ to produce these symbols (see <a href="http://www1.chapman.edu/~jipsen/mathml/asciimathextend.html">http://www1.chapman.edu/~jipsen/mathml/asciimathextend.html</a> ). The philosophy of ASCIIMath is that the input text should be readable and easy to type.  E.g. if there is an ASCII character that looks similar to the symbol, then either this character or two adjacent copies of this character produce the symbol. -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: Any hope of using ASCIIMathML syntax within an ASCIIsvg script?  I know that SVG doesn't support MathML, but since it supports unicode &amp; text offsets, it's at least conceivable that it could be done.  (P.S. I posted this in the FAQ section as well, so one post probably ought to be removed at some point.)
<p></p>
A: I'm looking into it. There were some efforts to render MathML in SVG, but I'm not up-to-date on this at the moment. -- Peter (Looks like this page has become the unofficial FAQ. Some of it may eventually be summarised on the FAQ page.)
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: What about spacing?  Currently, `AA x in bbbN. 4 &lt; x ^^ x &lt; 6 =&gt; x = 5` looks pretty hideous and I can't see how to change the input to put extra space after the full-stop and around the conjunction symbol (for example).  Great tool BTW!!
<p></p>
A: The problem is that `^^` is also used as an operation symbol (e.g. in lattice theory), so for the logical use additional space needs to be inserted (or a new symbol has to be defined). \  (backslash-space) inserts one space. E.g. `AA x in NN.\ 4 &lt; x\ ^^\ x &lt; 6\ =&gt;\ x = 5` -- Peter
<p></p>
Followup: Is it my browser?  I don't see any difference in the display of my formula and yours.  Here's one supposedly with lots of spaces: `4 &lt; x \ \ \ \ \ \ ^^\ \ \ \ \ \ \ x &lt; 6`.  
No difference on my screen.
<p></p>
A: Okay, that is interesting. Tell me what browser you are using and I'll check it out (it works for me with IE+Mathplayer and Mozilla/Firefox on Windows). -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: I'm pretty disappointed with the way Mozilla renders MathML (especially arrows); I also don't want to force users to download anything, so I'm writing a javascript math typesetting program that generates XBM's on the fly.  Most of it's done; I'm working on stuff like hats and parens now.  It should work on nearly every browser, even older versions, and will give a uniform rendering.  It comes with a perl script for converting BDF fonts to a collection of glyph objects; you can convert TTF to BDF with (who'd have thought ;) "ttf2bdf". Would you be interested in adapting your parser &amp; lexical analyzer to use it?
<p></p>
A: Interested yes, but I can't tell how much work this would be without more details about the input your typesetting program requires. Is there a demo page somewhere? Btw, perhaps you are already familiar with jsMath at <a href="http://www.math.union.edu/~dpvc/jsMath/">http://www.math.union.edu/~dpvc/jsMath/</a> . It seems to have similar aims and excellent typesetting quality. -- Peter
<p></p>
R: Hey, that's pretty nice.  Had I known about it, I probably wouldn't have started on this project. Anyway, it's still in development, but you can play with it if you'd like. <a href="http://www.cs.auckland.ac.nz/~msta039/XBMath.zip">http://www.cs.auckland.ac.nz/~msta039/XBMath.zip</a> Look at xbmath.html for an example.
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
I've created a small script for use with the Mozilla IRC client Chatzilla, that uses ASCIIMathML to render MathML "live". See <a href="http://mnenhy.mozdev.org/spinoff.html#texml">http://mnenhy.mozdev.org/spinoff.html#texml</a> . /Mnyromyr/
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: I also miss some features for stacking the symbols, but for formal methods in computer science. In particular symbols on top and under the arrows need support. In LaTeX, I write \xrightarrow{\tau} or \stackrel{\tau}{\rightarrow} for more general case. Are these features possible at all in MathML? /marius/
<p></p>
A: As far as I can tell, there is no MathML equivalent to \stackrel, but one can emulate the effect of stackrel using &lt; munder&gt;, &lt; mover&gt;, &lt; mpadded&gt; and/or &lt; mspace&gt; with appropriate attributes to move the symbols around. The outcome is dependent on the browser, so this is not quite what one would hope for. If one just wants a symbol on top of an arrow, &lt; mover&gt;...&lt; /mover&gt; will do reasonably well. This feature is currently not available in ASCIIMathML, but it should be included as mover{...}{...} in an upcoming release. --Peter
<p></p>
Update: stackrel{}{} has been incuded in ASCIIMathML as of version 1.4.1. -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: I noticed that expression sum_i^n is displayed differently on pages <a href="http://www1.chapman.edu/~jipsen/mathml/asciimathdemo.html">http://www1.chapman.edu/~jipsen/mathml/asciimathdemo.html</a> and <a href="http://math.chapman.edu/email/">http://math.chapman.edu/email/</a>. Is this intentional? /marius/
<p></p>
A: This is unintensional, and the "Email Editor" has now been updated to use ASCIIMathML 1.4. The behaviour you noticed shows the difference between "var displaystyle = true" and "var displaystyle = false" (a global variable at the top of ASCIIMathML.js). Most students are taught to write the limits of \sum, \prod, \lim,... below and/or above the main symbol, so this was chosen as the default behaviour for ASCIIMathML. --Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: Wonderful! One question:
 \lim_{2x}{3} and  lim_{2x}{3} display differently: $ \lim{::}_{2x}{3}$ and $ lim_{2x}{3}$.  Any suggestion for forcing the latter when parsing?  ((La)Tex produces mostly the former, but the latter looks better.)  Thanks! --Cathy
<p></p>
A: This is a bug. Thanks for noticing it. Seems to occur only when the formula starts with a space, followed by \lim (or \sum or \prod) at the beginning.
An easy fix (hack) is to replace line 674: 
<p></p>
node.appendChild(AMparseExpr(str)[0]); 
<p></p>
in ASCIIMathML.js (ver 1.4.1) with
<p></p>
node.appendChild(AMparseExpr(str.replace(/^\s+/g,""))[0]);
<p></p>
Please let me know if the same problem occurs in different contexts. (It will be fixed in the next version.) -- Peter
<p></p>
Update: it has been fixed (as of 1.4.2). If $sum{::}_(k=1)^n$ is preferred over $sum_(k=1)^n$, insert a pair of
invisible brackets after the $sum$, or (globally) change displaystyle = false in the script.
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: I am revisiting recursive descent grammars in my studies and wonder if ASCIIMath is related to the Berkeley work, "Parsing TEX into Mathematics" <a href="http://www.cs.berkeley.edu/~fateman/papers/parsing_tex.pdf">http://www.cs.berkeley.edu/~fateman/papers/parsing_tex.pdf</a>?  What are ASCIIMath's intellectual roots?
<p></p>
ASCIIMath is great! Thanks again! -- <a href="http://search.cpan.org/~gene/">[Gene Boggs]</a>
<p></p>
A: That's a good question. Now that ASCIIMathML is becoming more widely known, it is a good idea to record some of the background (before I forget too many details). In the near future I hope to include some information on the main ASCIIMathML webpages, but for now, here is a somewhat lengthy answer to your question.
<p></p>
I was not aware of the paper that you mention, but many thanks for the reference, it looks like I need to read it carefully (several years ago I did read some of R. Fateman's interesting papers on computer algebra systems).
<p></p>
For the rest of this answer see <a href="mathxml.pl?Historical_remarks_about_ASCIIMathML">Historical remarks about ASCIIMathML</a>. --Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: Another question for you, Peter.  I'd like to display variables etc within a mathematical expression using a normal (not italicised) font.  (I know mathematicians like italicised variables, but chemists often don't.)  Is there a way (css? something else?) to display even variables without the italics?  (I could in theory do it with text{ }, but that's a big hit in legibility for someone without a mathML enabled browser.)  Thanks!  --Cathy
<p></p>
A: The simplest way is to use "v" instead of v inside the expression (this is the same solution as using text{ }, but a bit more legible). Another solution is to hack the script so that it encloses variables with the &lt;mtext&gt; tag rather than the &lt;mi&gt; tag (just search for the line that includes the text: AMseparated?"mo":"mi" and change the "mi" to "mtext", then save the script and reload your webpage in the browser -- as a mathematician, I have to warn you that it's quite ugly :-).
<p></p>
The correct solution would be CSS, but so far I haven't figured out how to get this to work with ASCIIMathML. - Peter
<p></p>
R:  Thanks Peter, that works.  As a chemist, I must tell you that `Ca_3(PO_4)_2` is ugly in italics.
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: peter, asciimathml is great!  I'm totally blind so can't use a more graphical editor to produce maths.  The only thing  is, is there a way of saving the page using mathml instead of the ascii equivalents of the expressions.  This would mean that the results could be distributed without the javascript file and that they could be converted into other formats, ie latex, or for me, braille. Many Thanks
- Alastair
<p></p>
A: Yes, the ASCIIMathML Editor lets you do this (it is one of the links at the top of the ASCIIMathML homepage). You have to paste your ASCIIMathML text into the Textarea on the left (or type it there), and then click the View MathML button (next to the Update button on the right). The Textarea on the right will then contain the MathML output, which can be copied and pasted into a text editor and saved to a file. I'm curious what software you would use to translate the MathML to Latex or Braille. - Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: It does not appear to work in IE (6.0).  Any tips?
<p></p>
A: To diagnose the problem requires some more information. ASCIIMathML uses JavaScript, so if JavaScript is disabled in your browser (check Tools-&gt;Internet Options-&gt;Security-&gt;Active scripting) it needs to be enabled.
<p></p>
Here are some other questions that may help to identify the problem (don't worry, its usually not complicated to get it to work). What operating system are you using? (Windows XP?) Is MathPlayer installed? Does a webpage with (standard) MathML display correctly (see e.g. <a href="http://www.w3.org/Math/XSL/pmathml2.xml">http://www.w3.org/Math/XSL/pmathml2.xml</a> )? Does the ASCIIMathML homepage <a href="http://www1.chapman.edu/~jipsen/mathml/asciimath.html">http://www1.chapman.edu/~jipsen/mathml/asciimath.html</a> display correctly or does it generate a JavaScript error?
<p></p>
If it is not working on one of your own webpages, check that the header information is correct (see info on the download page). If you are using the .xml version of ASCIIMathML, make sure your webserver is sending the page out with the correct content (MIME) type. For .xml or .xhtml page the content type should be "application/xhtml+xml". Hope this helps. - Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: I'm afraid I just don't know anything about LaTeX, so: is there any way of changing the font that is used in AsciiMath ( and its size ) ? Anyway, many thanks for this tool !!!
<p></p>
A: No knowledge of LaTeX needed here. In version 1.4.4 (at <a href="http://www.chapman.edu/~jipsen/mathml/ASCIIMathML.js">http://www.chapman.edu/~jipsen/mathml/ASCIIMathML.js</a> ) the fontsize is now correctly inherited from the fontsize of the surrounding text (as set by CSS or using the deprecated &lt; font&gt; command). The fontfamily can be selected at the top of the script by setting the variable <tt>mathfontfamily</tt>. In IE, if this variable is set to the empty string, the font of the surrounding text is used. (For some unknown reason the Gecko renderer in Mozilla/Firefox/Netscape insists on using a serif fontfamily by default.) Similarly <tt>mathcolor</tt> can also be left empty now and will default to the color of the surrounding text. -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: AsciiMathML is wonderful! How can I get a one-column matrix? -- Carles
<p></p>
A: Good question. Simply use the standard syntax for matrices, but only put one entry in each row: \`((1),(2),(3))\` gives `((1),(2),(3))`. 
<p></p>
(For a one-row matrix you are out of luck, and instead have to use a row vector: (1\ 2\ 3) gives `(1\ 2\ 3)` or add an empty row: ((1,2,3),(,,)) gives `((1,2,3),(,,))`. Neither of these is really a good solution, but the standard syntax for one-row matrices such as ((1,2,3)) is also used in other situations where it should not be translated to matrix form; e.g. a_((1,2,3)) gives `a_((1,2,3))`. Well, simplicity comes with compromises...)
<p></p>
If for some reason you want to display matrix syntax without having it recognized as a matrix, just insert a pair of invisible brackets around some row: \`({:(1):},(2),(3))\` gives `({:(1):},(2),(3))`. -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q:  I was curious about the translation of an expression like x^2/2 (`x^2/2`), and why it results in an "mo" / tag rather than an "mfrac" tag as is used with the expression x/2 (`x/2`).
<p></p>
Also, I wanted to share an modification I made in case it might be useful to others.  I added the lines:
<pre>
if (typeof symbol.func == "boolean" &amp;&amp; symbol.func) {   // hack for functions
	node = AMcreateMmlNode("mrow",AMcreateMmlNode(symbol.tag,document.createTextNode(symbol.output)));
	node.appendChild(result[0]);
	return [node,result[1]];
      }
</pre>
prior to the lines:
<pre>
	AMremoveBrackets(result[0]);
      if (symbol == AMsqrt) {           // sqrt
</pre>
in the "case UNARY:" section of AMparseSexpr.  With this, I can define functions like sin:
<p></p>
{input:"sin",  tag:"mo", output:"sin", tex:null, ttype:UNARY, func:true}
<p></p>
so it acts like a function.  That way sin(x)/cos(x) will render as `(sin(x))/(cos(x))` instead of `sin(x)/cos(x)`.  
<p></p>
A: Great question and modification. I will add the latter to the next version (slightly modified to allow syntax like `sin^-1x`; see version 1.4.5 below). The question about the parsing of x^2/2 is really about operator precedence. Certainly the ASCIIMath philosophy is to parse such expressions in the same way as (x^2)/2. A year ago, when I wrote down the 7 BNF rules to parse the ASCIIMath syntax, I wanted to keep them as simple as possible so that the implementation would be reasonably fast. Your question prompted me to implement a version with one more rules (for I) that I had considered for quite some time now:
<pre>
c ::= [A-Za-z] | greek letters | numbers | other constant symbols
u ::= sqrt | text | bb | other unary symbols for font commands
b ::= frac | root | stackrel         binary symbols
l ::= ( | [ | { | (: | {:            left brackets
r ::= ) | ] | } | :) | :}            right brackets
S ::= c | lEr | uS | bSS             Simple expression
I ::= S_S | S^S | S_S^S | S/S | S    Intermediate expression
E ::= IE | I/I                       Expression
</pre>
It works quite well, and is only about 10% slower (in the current hack). Since it also matches the behavior of the ASCIIMath Calculator, this will likely be part of the upcoming version (try <a href="http://math1.chapman.edu/~jipsen/mathml/ASCIIMathML145.js">http://math1.chapman.edu/~jipsen/mathml/ASCIIMathML145.js</a> ). Thanks for your contribution. -- Peter
<p></p>
Followup:  Peter, I tried out the 1.4.5, and noticed that x^2/2 displays as `(x^2)/2`, but 2/x^2 displays as `2/x"^"2`.  I don't know if that's intentional or not, but thought I'd point it out :)
<p></p>
A: Thanks, that is not intensional but rather a consequence of the S/S clause (included at the last minute) and insufficient testing. Clearly the grammar needs some more thought (and 1.4.5 is still in beta). -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: I was trying to use S5 <a href="http://www.meyerweb.com/eric/tools/s5/">http://www.meyerweb.com/eric/tools/s5/</a> and ASCIIMath together (urrah for Javascript) and something strange happens. Using the body onload=... doesn't work, but using the translatebyid advice on this page, the mathml is rendered correctly. The weird thing is that the horizontal lines of the fractions do not disappear, but are on every page. 
<p></p>
Actually, it's a Firefox bug. Using Explorer the lines behave correctly. It looks like the slides appear and disappear using the style.visibility = 'hidden' or 'visible'. I'm off to bugzilla! 
<p></p>
I uploaded an image of my problem to <a href="http://207.210.65.105/s5asciimathml.png">[1]</a> 
I am using Firefox 1.0.4 on WinXP. 
<p></p>
Using a newer version of Firefox (Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050521 Firefox/1.0+)
the lines disappear. Excellent! -- Carlo
<p></p>
A: Wow, S5 is really cool. I tried ASCIIMathML with <a href="http://meyerweb.com/eric/thoughts/2005/02/03/s5-11b5/">http://meyerweb.com/eric/thoughts/2005/02/03/s5-11b5/</a> and did not see any problem with horizontal lines of fractions in Firefox (or Explorer). Btw, I used &lt; body onload="translate();startup()" &gt; to get get both ASCIIMathML and S5 started in the right order; see source of <a href="http://math.chapman.edu/~jipsen/mathml/S5slides/S5andASCIIMathML.html">http://math.chapman.edu/~jipsen/mathml/S5slides/S5andASCIIMathML.html</a>. (Not sure if this is the "right" way, but it seems to work.) -- Peter
<p></p>
I'm using a recent nightly build of Firefox from <a href="http://www.mozilla.org/developer/">http://www.mozilla.org/developer/</a>, and the problem with the fractions is not showing up. Perhaps it has been fixed? (The Firefox version info is: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050501 Firefox/1.0+) -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: ASCIIMath: Bravo Bravissimo! Thank you very much for this great tool! I used so far MathCast and copied the MathML-Text into the Editor. Now writing equations is so much easier for me! I have two hints at the moment:
1) Maybe adding
     var mathsize  = "1.2em";
and later
     if (mathsize != "")  node.setAttribute("mathsize",mathsize);
seems to be a good idea (for me) to enhance the skin of the document.
<p></p>
May be setting color and size as a parameter for the translate()-function allows the user changing both without editing the JavaScript File?
<p></p>
2) With german characters \$&#228;\$, \$&#246;\$, \$&#252;\$ etc. the italic scripting does not work. I cannot see the place in your script, where I have to change this?
<p></p>
In advance, thank you very much for your support -- Gerhard
<p></p>
A: Thanks, I like your suggestions, so they'll probably make it into the next version (of course you can add them already to your script). Not sure what's going on with the umlaut characters in italic, but I'll look into it. -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q. First off - thank you for bringing us ASCIIMath. 
<p></p>
As part of a system to teach and (soon) allow authoring of maths, I'm incorporating the ASCIIMathML editor into a web-form that can then be submitted to the system for processing. One thing I've noticed is that if you clear the textfield containing the asciimath then start typing away it doesn't update (ever) until you enter your first asciimath snippet - ie you can type a complete plain-text paragraph and it won't update - even after pressing 'Update'. I'm investigating this myself, but this looks like a bug. I'm using v1.4.3 of ASCIIMathML.js but the same thing happens on your editor page which uses 1.4.6. 
<p></p>
Any ideas?
<p></p>
Thanks - Keith
<p></p>
A: Yes, this is a bug -- thanks for noticing it. The problem is that to preserve linebreaks, the text is put in a comment, and only if a math formula occurs in the text does ASCIIMathML.js change the comment to a &lt;span&gt;. A simple hack is to change line 83 of ASCIIMathMLeditor.js to 
<pre>
outnode.appendChild(document.createComment(str+"``"));
</pre>
However a better approach would be to avoid the comment hack in the first place. For .html files the editor can be improved to allow html tags, and the text then has to be added to outnode with .innerHTML (but this won't work with xml versions of ASCIIMathML). Our students use the HTMLarea editor in Moodle (modified for ASCIIMathML) since that has nice buttons for the HTML formatting. Unfortunately I haven't figured out how to make that work on a standalone webpage yet. -- Peter
<p></p>
---
<p></p>
The file aciimathXMLhowto.xml didn't work. The HR tabls need the slash at the end.
That is:
<p></p>
<pre> &lt;hr&gt; should be &lt;hr/&gt;</pre>
<p></p>
 The same thing must be done for the metta tag and the image tag. The document should begin with:
<p></p>
<pre>
&lt;?xml version="1.0"?&gt;
&lt;?xml-stylesheet type="text/xsl" href="pmathml.xsl"?&gt;
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:mml="http://www.w3.org/1998/Math/MathML"&gt;
</pre>
<p></p>
A: Thanks for pointing that out. In fact that file and the other .xml files in the distribution of ASCIIMathML will be removed soon. ASCIIMathML.js currently works well with the standard MathML DTD on both IE and Firefox with XHTML pages that pass validation tests, so pmathml.xsl is no longer needed. -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: On Firefox 1.5 final OS X everything works fine except the - signs don't show up, do you have any idea why this might be? I have run the MathML font installer a few times and tried explicitly adding a command to map "-" to \u002D, but no luck. The - shows up in the DOM tree, so I'm inclined to believe it's just a rendering problem with Firefox, but it's a pretty annoying one. I've found \u0096 shows up, so I've added this mapping, but it's a weird hack. If it works on other platforms maybe the code could simply include it?
<p></p>
A: Yes, I've heard from others that this is a bug on the Mac-version of Firefox 1.5 and believe there is some upcoming version (1.6?) that fixes it (\u0096 does not work on WinXP IE or Firefox). This is really a browser implementation issue that is outside the scope and/or control of ASCIIMathML. If someone knows more about this and how to fix it easily on a Mac, please add your wisdom here. (Sorry, I don't have simple access to a Mac.) -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: I hate writing say, $int f(x) dx$, and seeing ... d x, split. Now, Unicode abandoned negative spacing. How can I force AsciiMathML to keep dx together? "dx" produces non-italic text. Hmmm. Perhaps change the style of "dx"? Or, how to include the appropriate &lt;mspace&gt; in order to get what I need? Thank you for any suggestion. [Jerzy Karczmarczuk, Caen, France].
<p></p>
A: This seems to be browser and/or OS dependent. On WinXP with IE+MathPlayer and Firefox the dx displays without any space between the d and the x. I have to check on Linux to see how it works there. ASCIIMathML translates dx as two identifiers, i.e. as &lt;mi&gt;d&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt; which displays the character in italics. If one changes that to &lt;mi&gt;dx&lt;/mi&gt;, then the default font changes to roman, so the characters become upright. It should be possible to override the default with a surrounding &lt;mstyle&gt; tag, but this requires some changes to the script. I believe it would be a better solution if mathml-aware browsers displayed adjacent mathml identifiers without visible space between them.
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: There is a formula, which isn't correctly displayed, both with Explorer and Firefox:
<p></p>
The Code:
[bb A_l] = 1/2 * [bb A_l]|_{Vollfarbe} + 1/2 * [bb A_l]|_{Rot-Cyan} = [[0.799, 0.293, 0.057],[0,0,0],[0,0,0]]
<p></p>
The formula:
$[bb A_l] = 1/2 * [bb A_l]|_{Vollfarbe} + 1/2 * [bb A_l]|_{Rot-Cyan} = [[0.799, 0.293, 0.057],[0,0,0],[0,0,0]]$
<p></p>
The Index "Rot-Cyan" is displayed correctly, but the Index "Vollfarbe" not. Why? Is this  a bug?
Thanks for any hint. [G.Herbig, Germany]
<p></p>
A: This has to do with |...| being interpreted as absolute value brackets, so the first occurance of | behaves differently from the second (a careful rewrite of the parser could eliminate this quirk). A possible fix is to surround the | by invisible braces {:|:}
<p></p>
$[bb A_l] = {:1/2 * [bb A_l]{:|:}_"Vollfarbe" + 1/2 * [bb A_l]{:|:}_"Rot-Cyan":} = [[0.799, 0.293, 0.057],[0,0,0],[0,0,0]]$
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: I am trying to get a common Actuarial Symbol that is basically a top and right border around a value. The closest I can get is $ddot a _{bar n  |}$. Any ideas on how to connect the two borders? I know future versions of MathML are going to support this using a notation parameter, but current browsers don't support it. Thanks for any suggestions [Kevin Howard, Atlanta, Georgia]
<p></p>
A: You can try adding the following line in your HTML page:
<p></p>
<script>newcommand("urcorner","\u231D")</script><pre>&lt;script&gt;newcommand("urcorner","\u231D")&lt;/script&gt;</pre>
<p></p>
and then \$n urcorner\$ produces $n urcorner$. This is probably not as close to the $n$ as you would like, but perhaps it is useful. -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q. I wonder if you know of a way to go from an ASCIIMathML file to a postscript file? I've thought of several solutions (can ASCIIMathML output the MathML as a text file on which we could then do MathML2ps?), but none seem very elegant. Ideas? Thanks in advance, it's a lovely tool. 
<p></p>
A: Yes, it is possible to convert the ASCIIMathML to a MathML textfile. E.g. the ASCIIMathMLeditor has the ability to output MathML as text, and this could also be done directly in JavaScript with .innerHTML . Ideally you would then want to send the output back to a server to process it automatically with MathML2ps. Obviously a serverside ASCIIMathML would eliminate doing the conversion on the client (e.g. one could try ASCIIMathMLPHP). If a pdf file is useful, then PDFcreator is an option (at least on WinXP; it sends printer output directly to a pdf file). -- Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
At first thanks to the answers, which you have given here before! Now I have a question, which is not directly related
to ASCIIMath but is very general, when writing formulas. Has anyone any idea to set proper equation numbers??? I tried it now
several hours and I have looked around at all these example pages and also here on the question site: No answer! But I'm sure,
_everybody_ must has the same problem!
<p></p>
Q: How can I write equation numbers using html and/or style sheet, so that the equations itself are text-indented and the equation numbers
are at the end of the same line? Any idea? Any link? Thanks. [G.Herbig, Germany]
<p></p>
A: One way to do this is with a html table, e.g.
<p></p>
&lt; table width="100%"&gt;&lt; tr&gt;&lt; td align="center"&gt;\`1/(1+1/(1+...))=(sqrt5-1)/2\`&lt;/td&gt;&lt; td align="right"&gt;(1.1)&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
<p></p>
produces
<table width="100%"><tr><td align="center">`1/(1+1/(1+...))=(sqrt5-1)/2`</td><td align="right">(1.1)</td></tr></table>
--Peter
<p></p>
A2: Something I have been playing around with is this CSS:
<p></p>
p.math { counter-increment: eqn-num; text-align: center; font-style: normal; }
<p></p>
p.math:before { content: "(" counter(eqn-num) ")"; margin-bottom: -1.5em; display: block; text-align: right; }
<p></p>
The HTML is much simpler:
<p></p>
&lt; p class="math"&gt;\`1/(1+1/(1+...))=(sqrt5-1)/2\`&lt; /p&gt;
<p></p>
which produces:
<p></p>
<style type="text/css">p.math {counter-increment: eqn-num;text-align: center; font-style:normal;}
p.math:before { content: "(" counter(eqn-num) ")"; margin-bottom: -1.5em; display: block; text-align: right;}</style><p class="math">`1/(1+1/(1+...))=(sqrt5-1)/2`</p>
<p></p>
- Bob Bottomley, UC Riverside
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: This is a very nice and useful script. I wonder if it would be possible to icorporate ASCIIMath functionality into TiddlyWiki via a plugin? I know about ASciencePad, but it doesn't allow to make WYSIWYG editing switched off by default, and users cannot update it to the latest version of TiddlyWiki which has some useful features such as highlighting search terms. -- Szabolcs
<p></p>
A: This is a useful suggestion. It should be fairly easy to do by looking at how the jsMath plugin for TiddlyWiki works. (This wouldn't provide the WYSIWYG editor of ASciencePad, but it would be easier to upgrade. BTW, in ASciencePad the WYSIWYG editor is disabled for all tiddlers that have a tag starting with "system".) - Peter
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Q: Are there any examples on how to include the value of a javascript variable in a ASCIIMath equation?
The nearest I have come to it so far is:
<p></p>
<pre>
  &lt;script&gt;
    c = 3
    setText(c, "cval")
    setText(c, "ccval")
    setText(c, "cccval")
  &lt;/script&gt;
  &lt;p&gt;This `y = sin(pi * x + &lt;span id="cval"&gt;&lt;/span&gt; * pi)`  Almost works!!!!!!!!&lt;/p&gt;
</pre>
<p></p>
The following works
<p></p>
<pre>
 &lt;p&gt;y = sin(pi * x + &lt;span id="ccval"&gt;&lt;/span&gt; * pi)&lt;/p&gt;
</pre>
<p></p>
but `pi` is not displayed nicely.
<p></p>
<pre>
  This `y = sin(pi * x +` &lt;span id="cccval"&gt;&lt;/span&gt; ` * pi)` works, but is ugly.
</pre>
<p></p>
I am trying to combine the above with ASCIIsvg and a couple of buttons to produce a dynamic page in which c is updated
via the buttons then a new graph of the function is drawn and the equation is updated when the page is redisplayed (locally).
<p></p>
The above example is possibly too simple, I really need to place these values inside a fraction. Hence the need to do it inside the equation:
<p></p>
<pre>
&lt;p&gt;
$\lim_{q\to p}\frac{&lt;span id="fqval"&gt;&lt;/span&gt;-&lt;span id="fpval"&gt;&lt;/span&gt;}{&lt;span id="qval"&gt;&lt;/span&gt;-&lt;span id="pval"&gt;&lt;/span&gt;} = &lt;span id="dval"&gt;&lt;/span&gt;$
&lt;/p&gt;

&lt;p&gt;
\lim_(q-&gt;p)((&lt;span id="ffqval"&gt;&lt;/span&gt;-&lt;span id="ffpval"&gt;&lt;/span&gt;)/(&lt;span id="qqval"&gt;&lt;/span&gt; - &lt;span id="ppval"&gt;&lt;/span&gt;)) = &lt;span id="ddval"&gt;&lt;/span&gt;`
&lt;/p&gt;
</pre>
<p></p>
<b>N.B.</b> Each "span" in a page must have a unique name otherwise it will not display. This means you need to use several setText commands. 
<p></p>
Has anyone tried to do Javascript (like script.aculo.us) or looked into SMIL animation as a way to manipulate the MathML DOM.  I'm trying to
develop a presentation/animation tool to show problem solving.  Eventually, I'd like to do this on a wiki, so that is where asciimath really
(REALLY) comes in handy! My guess is that I will need to add a way to add IDs to the nodes of the DOM inside the MathML that is generated so that I can later  manipulate it (replace it) with other MathML nodes.  Any thoughts on that - I have not looked through the code yet...just asking. I'm also looking at the S5 project for the presentation stuff. The dream is a open wiki of presentations and problem solutions that anyone anywhere can look at.
<p></p>
Brian Repko (brianrepko at fastmail dot us)
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Sorry but my English is poor.
<p></p>
Suggestion:
<p></p>
<pre>
function AMprocessNodeR(n, linebreaks) {
  var mtch, str, arr, frg, i;
  if (n.childNodes.length == 0) {
    if ((n.nodeType!=8 || linebreaks) &amp;&amp;
      n.parentNode.nodeName!="form" &amp;&amp; n.parentNode.nodeName!="FORM" &amp;&amp;
      n.parentNode.nodeName!="textarea" &amp;&amp; n.parentNode.nodeName!="TEXTAREA" &amp;&amp;
      n.parentNode.nodeName!="pre" &amp;&amp; n.parentNode.nodeName!="PRE") {
      //...
    }
  } else if (n.nodeName!="math") {
    for (i=0; i&lt;n.childNodes.length; i++)
      i += AMprocessNodeR(n.childNodes[i], linebreaks);
  }
  return 0;
}
</pre>
<p></p>
will be better if
<p></p>
<pre>
function AMprocessNodeR(n, linebreaks) {
  var mtch, str, arr, frg, i;
  if (n.childNodes.length == 0) {
    if (n.nodeType!=8 || linebreaks) { //////////////////// (1)
      //...
    }
  } else if (n.nodeName!="math" &amp;&amp;
    n.nodeName!="form" &amp;&amp; n.nodeName!="FORM" &amp;&amp;
    n.nodeName!="textarea" &amp;&amp; n.nodeName!="TEXTAREA" &amp;&amp;
    n.nodeName!="pre" &amp;&amp; n.nodeName!="PRE") { //////////////////// (2)
    for (i=0; i&lt;n.childNodes.length; i++)
      i += AMprocessNodeR(n.childNodes[i], linebreaks);
  }
  return 0;
}
</pre>
<p></p>
(2) has two effects.
<ol>
<li> pre and form can have child or child-child or child-child-child... nodes, so checking only parent node is not enough.</li>
<li> We don't go into pre, form, textarea anymore, so we can save processing power.</li>
</ol>
<p></p>
Because of (2), I think (1) will be ok. But I'm not sure.
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
I do web programming and graphic design/UI ... It'll be great when the day comes that web design uses more of these mathematical equations to display and format sites. It could create some amazing sites for those creative people out there who mix codes with images. -(Josh at SurrealArt dot com) My <a href="http://www.SurrealArt.com">[Surrealism]</a> gallery. - Jeon, Sang-Yeon (jof4002 at gmail dot com)
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Hello, all of you. I put some (x)html code in a string variable. This code contains AsciiMathML information, like $ sqrt x $. When a JS command loads some &lt;div&gt; with the string via the InnertHTML method, the string is not parsed so that I just see an ugly $ sqrt x $ and not the nice root I was expecting. Can you help me. Thanks
- H.V. Brussels.
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Hi, I already e-mailed Peter Jipson separately, but I just wanted to say thanks publicly for this wonderful piece of software. I've used it to add some functionality to a piece of open-source software of my own (<a href="http://www.lightandmatter.com/spotter/spotter.html">http://www.lightandmatter.com/spotter/spotter.html</a>), and I'm very grateful.
- Ben Crowell
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
Hi, Is there a way to produce bold, non-italic variables? Without using &lt;mtext&gt;?
<p></p>
<hr noshade="true" size="1"></hr>
<p></p>
I did not want the use of a second delimiter, the dollar, on my system, the delimiter left-quote (back-tick) being enough, and I did not want all dollar blocks getting parsed and rendered by AsciiMathML. Editing the .js file to have this seems to work for my purpose.
<p></p>
   var AMdelimiter2 = null, AMescape2 = null, AMdelimiter2regexp = null;
<p></p>
Patnaik
<p></p>
<hr noshade="true" size="1"></hr>
<hr></hr>
<form method="post" action="mathxml.pl" enctype="application/x-www-form-urlencoded">
<a href="mathxml.pl?HomePage">HomePage</a> | <a href="mathxml.pl?RecentChanges">RecentChanges</a> | <a href="mathxml.pl?action=editprefs">Preferences</a><br></br>
This page is read-only | <a href="mathxml.pl?action=history;id=ASCIIMath_Comments_and_Suggestions">View other revisions</a><br></br>Last edited September 18, 2007 6:28 pm <a href="mathxml.pl?action=browse;diff=1;id=ASCIIMath_Comments_and_Suggestions">(diff)</a><br></br>Search: <input type="text" name="search"  size="20" /><input type="hidden" name="dosearch" value="1"  /></form><script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-2263958-2";
urchinTracker();
</script>

</body>
</html>