title: converting plain ascii math or ascii art to mathml / latex
body: <p>I'v been trying to determine the best way to convert the output from some computer algebra systems to some presentable format (mathml, latex), what would be the bestway? </p>
  
  <p>i tried using the plain ascii representation, and converting to mathml, but the results are not always correct, i'v been thinking of getting the 2-d ascii art representation and changing it to mathml, are there libraries out there that can do this (im working with python)
  i tried <a href="https://pypi.python.org/pypi/asciimathml/" rel="nofollow">one</a> and <a href="https://pypi.python.org/pypi/asciitomathml/.86" rel="nofollow">two</a>, but they only work with simple ascii not 2-d ascii. </p>
  
  <pre><code>                                      %pi
                                    3 %e      3
  (%o1)                             ------- - -
                                       5      5
  
  (%o3) 3*%e^%pi/5-3/5
  </code></pre>
  
  <p>both of the above are pretty much the same according to maxima, but converting them to 
  mathml yields imperfect results, because of the '%' the order of precedence is messed up and pi ends up multiplying e rather than superscipt. Would substituting '%pi' for 'pi' be sufficient?  </p>