'; SDV($GUIButtons['ASCIIsvg'],array(1000, '\\\begin{graph} ', ' \\\end{graph}', 'width=300; height=200; xmin=-6.3; xmax=6.3; xscl=1; plot(sin(x));', '$ASCIIMathMLUrl/graph.gif"$[ASCIIsvg-graph]"')); SDV($GUIButtons['ASCIImath'],array(1000, '', '', 'sqrtn', '$GUIButtonDirUrlFmt/math.gif"$[Math formula (ASCIIMath)]"')); Math etc - ASCII Math FAQ

# ASCII Math FAQ

Why another syntax for math formulas?

Most of the syntax for ASCIIMath is well-known, and students use similar constructions in email. ASCIIMath is simply standardizing this syntax and translating it into nicely readable MathML.

How do I add ASCIIMathML to a wiki, blog or CMS?

Usually this is quite simple since one only has to ensure that the ASCIIMathML.js script is part of each page of the wiki, blog or CMS. If the system is written in PHP, this means a line like

 echo '<script src=http://your.domain.edu/your/path/to/ASCIIMathML.js></script>(approve sites)'."\n";


should be added in some php file that generates the header of each webpage.

Why do some brackets (and commas) disappear?

The infix binary operations /, _ (subscript) and ^ (superscript) are "self-delimiting" in the second argument (both arguments for /) when they are displayed in MathML. This means the outer pair of brackets is not required anymore, hence not displayed. Similarly, for a matrix ((a,b),(c,d)), the inner brackets (and commas) are not needed when the matrix is displayed.

Why does ASCIIMath allow non-matching brackets?

Some mathematical constructions require this flexibility, e.g. half open intervals (a,b]. Also to allow the discussion of incorrect mathematical expressions, it is necessary that the syntax is not strict.

Why are all formulas in blue?

This helps authors find missing left-quotes. It can be switched to black (or another color) by inserting (an appropriate version of) the following line in the document <pre><script>mathcolor="Black"</script></pre>

Why not simply use LaTeX? (see http://www.latex-project.org/(approve sites))

For students who are not familiar with LaTeX, this is not as easy as the ASCIIMath syntax. Of course basic LaTeX formulas can also be used with ASCIIMath.

Why change the LaTeX \$-signs to back-quotes? One of the main aims of ASCIIMath is that even the input form should be as readable as possible. The \$-signs are visually more distracting when reading the input. It also indicates to other authors or programs that the formula is not standard LaTeX. As of version 1.2, \$-signs can be used as well, but it is recommmended that they be used for formulas written in (La)TeX. To write a \$-sign in plain text, use \\$(likewise for left-quotes). Both escape sequences work since version 1.2. In version 2.0 the auto-math-recognize mode makes back-quotes superfluous. Just surround the entire text by amath...endamath. Can formulas be displayed (as with \$\$...\$\$in LaTeX)? Yes, \$\$...\$\\$ is now available for LaTeX formulas. A few LaTeX environments are also recognized, such as \begin{theorem/lemma/corollary/proof/itemize/enumerate/center}, \emph{}, ...

Is there something like \newcommand in ASCIIMathML?

Yes, but without parameters. Suppose you want DD to expand to d/(dr). Add the following line anywhere in the body (or head) of your file:

 <script>define("DD","d/(dx)")</script>


Then try \DD(4/3pir^3)=4pir^2\ on your webpage.

For LaTeX extensions use

 <script>newcommand("\\DD","d/(dx)")</script>