Is there anyway to get asciimath to recognize "\over"?

Thanx

This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.

Is there anyway to get asciimath to recognize "\over"?

Thanx

Sure - but it's not single character (ttype CONST)

First you need to know if you want to use asciimathml or latexmathml input/output values and you need to check code for handling {this} \over {that} both for MathML and AMT fallback (unless you want to use only MathML)

Can't you simply use `2/3` or $\frac{2}{3}$ to render $$\frac{2}{3}$$

The problem I have is I am using asciimath on my Sage server to do the pretty print

Try

The Sage functions that do most of the work and I use Sage's "latex()" to convert my equations into pretty print. The latex() at times creates \over which asciimath does not recognize. My servers are not in Moodle at this moment.

Well, as Mauno indicated, you could add \over to asciimathml, but there may be some problems in that you simply can't add a replacement value as \over works in a different way than \frac (the latter taking two arguments).

Perhaps the more graceful approach ;) would be to research the various SAGE options (SAGE has LOTS of options) and determine why it is producing \over and what options there might be to avoid that. The person responsible for the function I believe is:

syntax is out of place in a LaTeX document. Using them at surface

level in a document also makes it very difficult to achieve certain kinds

of typesetting improvements that would otherwise be possible. Some

additional details are given in the file technote.tex. "

http://www.ams.org/tex/amsmath-faq.html

Source code for the function I believe is here:

http://sage.math.washington.edu/home/mhansen/sage-epydoc/sage.misc.latex-pysrc.html#latex

which offers some latitude in addressing this without rewriting asciimathml, and I am curious as to the impact of using the jsmath attribute .......

Perhaps the more graceful approach ;) would be to research the various SAGE options (SAGE has LOTS of options) and determine why it is producing \over and what options there might be to avoid that. The person responsible for the function I believe is:

The literature I have read suggests that while \frac is core Latex, \over is a primitive that "is out of place in a LaTeX document", and hence should be probably avoided anyway..... though in its defense Davide's jsmath does parse it correctlyWilliam Stein <wstein@gmail.com>

` "\over`

and friends are primitive TeX commands whose unusual syntax is out of place in a LaTeX document. Using them at surface

level in a document also makes it very difficult to achieve certain kinds

of typesetting improvements that would otherwise be possible. Some

additional details are given in the file technote.tex. "

http://www.ams.org/tex/amsmath-faq.html

Source code for the function I believe is here:

http://sage.math.washington.edu/home/mhansen/sage-epydoc/sage.misc.latex-pysrc.html#latex

which offers some latitude in addressing this without rewriting asciimathml, and I am curious as to the impact of using the jsmath attribute .......