Convert AsciiMath to TeX.
This PHP class converts AsciiMath expressions in TeX expressions. In this way KaTeX (which is much lighter and much faster than MathJax) can be used to render AsciiMath.
PHP >= 7.0 is required.
class AsciiMathToTex {
/* Methods */
public __construct(string $decimal = ".")
public parse(string $asciimath): string
}
require "asciimathtotex.php";
$parser = new AsciiMathToTex();
$asciimath = "x=(-b+-sqrt(b^2-4ac))/(2a)";
$tex = $parser->parse($asciimath);
This class is a port of the original asciimath2tex 1.50 by Christian Lawson-Perfect.
Giovanni Salmeri.