'''AsciiMath''' is a client-side [[mathematical markup language]] for displaying mathematical expressions in [[web browser]]s.<ref name="gray">{{citation|first=James|last=Gray|year=2007|title=''ASCIIMathML'': now everyone can type MathML|journal=MSOR Connections|volume=7|issue=3|pages=26–30|doi=10.11120/msor.2007.07030026}}.</ref><ref>{{citation|title=Interactive LATEX to MathML/HTML translation|first=Brian|last=Johnson|url=http://brianjohnsen.dk/bachelor.pdf|date=January 2005|publisher=Maersk Mc-Kinney Moller Institute for Production Technology, University of Southern Denmark, Odense|access-date=2015-04-20|archive-url=https://web.archive.org/web/20160304024109/http://brianjohnsen.dk/bachelor.pdf|archive-date=2016-03-04|url-status=dead}}.</ref>
Using the [[JavaScript]] script ASCIIMathML.js, AsciiMath notation is converted to [[MathML]] at the time the page is loaded by the browser, natively in [[Mozilla Firefox]], [[Safari (web browser)|Safari]], and via a plug-in in [[IE7]]. The simplified markup language supports a subset of the [[LaTeX]] language instructions, as well as a less verbose syntax (which, for example, replaces "\times" with "xx " or "times" to produce the "×" symbol). The resulting MathML mathematics can be styled by applying [[CSS]] to class "mstyle".<ref>{{citation ▼
AsciiMath first originated in 2009, published as an extension by Atlassian using MathJax.
Exploring various features of AsciiMathML it was discovered that once installed (per the default instructions) the filter did not turn off (There is a Tracker item on this [need to add reference]. It is argued that this behavior may be due to artifacts in the usage of require_js ) and that there were issues with the filter not interacting appropriately with the Moodle quiz and message modules. It is possible that the filter may be made to behave more like a filter if the javascript files are moved and the php files edited to reflect their ___location.
For the interim it was determined that asciimathml.js works very well if simply referenced in meta.php, and for those interested in using ASCIIMathML, it is suggested that a reference to it be placed in the appropriate theme and that a "common" ___location for the distribution files be identified (see below)
Additionally, a php version of ASCIIMathML has been developed by Steve Chan. Depending on usage, using the php version may or may not require the concurrent usage of an additional javascript file (arguably, if the web application displays XHTML, which Moodle does, the additional javascript file is not necessary.)
Stemming from an initial joint project with Peter Jipsen, David Lippman has also maintained a version of ASCIIMathML.js that provides fallback to a TeX interpreter such as mimetex. This can be important because ASCIIMathML requires that a) the browser used supports MathML (A W3C standard that Safari, for example does not support) and b) that adequate Math fonts are available to the browser (see note below about obtaining and installing fonts).
As part of extending the fallback option to make ASCIIMathML usage more transparent for usage on Moodle, a Moodle version will be available.
▲Using the [[JavaScript]] script ASCIIMathML.js, AsciiMath notation is converted to [[MathML]] at the time the page is loaded by the browser, natively in [[Mozilla Firefox]], [[Safari (web browser)|Safari]], and via a plug-in in [[IE7]]. The simplified markup language supports a subset of the [[LaTeX]] language instructions, as well as a less verbose syntax (which, for example, replaces "\times" with "xx" to produce the "×" symbol). The resulting MathML mathematics can be styled by applying [[CSS]] to class "mstyle".<ref>{{citation
| last1 = Sorge | first1 = Volker
| last2 = Chen | first2 = Charles
| publisher = ACM
| title = Proceedings of the 11th Web for All Conference (W4A '14)
| year = 2014}}.</ref>| s2cid = 6892997
}}.</ref>
The script ASCIIMathML.js is freely available under the [[MIT License]].<ref>[https://github.com/mathjax/asciimathml/blob/master/LICENSE asciimathml/LICENSE at master · mathjax/asciimathml]</ref> The latest version also includes support for [[Scalable Vector Graphics|SVG]] graphics, natively in [[Mozilla Firefox]] and via a plug-in in [[IE7]].
Per May 2009 there is a new version available. This new version still contains the original ASCIIMathML and LaTeXMathML as developed by Peter Jipsen, but the ASCIIsvg part has been extended with linear-logarithmic, logarithmic-linear, logarithmic-logarithmic, polar graphs and pie charts, normal and stacked bar charts, different functions like integration and differentiation and a series of event trapping functions, buttons and sliders, in order to create interactive lecture material and exams online in web pages.
ASCIIMathML.js has been integrated into [[MathJax]], starting with MathJax v2.0.<ref>{{cite web|url=http://www.mathjax.org/mathjax-v2-0-beta-now-available-on-cdn/ |title=MathJax v2.0 beta available|date=11 February 2012 }}</ref><ref>{{citation|title=MathJax: A Platform for Mathematics on the Web|first=Davide|last=Cervone|journal=[[Notices of the AMS]]|volume=59|issue=2|date=February 2012|url=httphttps://www.ams.org/journals/notices/201202/rtx120200312p.pdf|pages=312–316}}.</ref>
== SyntaxExample ==
Most AsciiMath symbols attempt to mimic in text what they look like rendered, like <code>oo</code> for ∞. Many symbols can also be displayed using a TeX alternative, but a proceeding backslash is not required.
For a list of all symbols and their respective syntax, visit: http://asciimath.org/
== Example<ref>{{Cite web|title=AsciiMath|url=http://asciimath.org/|access-date=2021-04-02|website=asciimath.org}}</ref> ==
The well-known [[quadratic formula]]
looks like this in AsciiMath:
<nowiki>x=(-b +- sqrt(b^2 – 4ac))/(2a)</nowiki>
== Issues ==
=== Failure to display some tex ===
ASCIIMathML was intended to provide a quick and easy alternative to use and display of the text syntax employed by (la)tex. While it does this well, when it comes to the incremental features of either parsing and displaying tex text expressions, or if using fallback, converting asciimathml text expression to tex, there are occasions upon which the results of problematic. Most often, this can be resolved through using an alternative text expression that parses to the same results, and there is discussion in the Math Tools forum on such usage. Additionally, there is continuing research and effort in trying to provide a quick, easy, and seamless way to write and display math online.
=== Font usage generally ===
While Firefox does do MathML, the results are problematic without appropriate fonts. Initially the MIT fonts were recommended while Mozilla now recommends the STIX beta fonts. There has been some continuing discussion on whether Firefox should bundle such fonts, but at present you will have to download and install fonts separately. This is very easy to do and there are "how to's" to assist you.
=== Specific font issues ===
Discussion in the Assciimathml google group continues to yield "fixes" for specific font issues as possible, though some issues may reside in the browser. Some of these issues have been later resolved with tinyMCE and asccimathtml
=== Fallback ===
David Lippman developed a fallback script (a version is offered above) that invokes mimetex or mathtran if for some reason the script determines that the current browser can't display MathML. Versions have been passed about that provide session cookies so that warnings are provided once, that do away with any warnings, etc. At some point a full set of versins with explanations may be available, or perhaps a script with specific internal configuration instructions. In the meantime, if you have any questions post them to the Math Tools forum and we will try to answer them as quickly as possible
== References ==
{{reflist|30em}}
{{reflist|30em}}<ref>{{Cite web|title=ASCIIMathML - MoodleDocs|url=https://docs.moodle.org/310/en/ASCIIMathML|access-date=2021-04-02|website=docs.moodle.org}}</ref>
==External links==
[[Category:Lightweight markup languages]]
[[Category:Mathematical markup languages]]
{{compsci-stub}}
|