<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 76: latex will not render for exponents of asin, acos, atan</title><link href="https://sourceforge.net/p/stack/bugs/76/" rel="alternate"/><link href="https://sourceforge.net/p/stack/bugs/76/feed.atom" rel="self"/><id>https://sourceforge.net/p/stack/bugs/76/</id><updated>2012-02-27T05:40:34Z</updated><subtitle>Recent changes to 76: latex will not render for exponents of asin, acos, atan</subtitle><entry><title>latex will not render for exponents of asin, acos, atan</title><link href="https://sourceforge.net/p/stack/bugs/76/" rel="alternate"/><published>2012-02-27T05:40:34Z</published><updated>2012-02-27T05:40:34Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netba56df93d1c8f46190d27d5b28ceebe03fda005a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The problem is with the latex that is generated, it is the same for asin, acos, and atan. For example (asin(x))^3 is rendered as sin^{-1]^3(x) which causes problems due to the double exponent. One possibile fix would be to simply represent sin^{-1} as arcsin. I do not pretend to know your source code very well but I did manage to implement this by changing the file displayCASText to be:&lt;br /&gt;
else // Assume STACK returns raw LaTeX for subsequent processing, e.g. with JSMath.&lt;br /&gt;
{&lt;br /&gt;
$this-&amp;gt;strin = $str-&amp;gt;wrapAround();&lt;br /&gt;
$this-&amp;gt;captureFeedbackTags();&lt;br /&gt;
$this-&amp;gt;capturePRTFeedbackTags();&lt;br /&gt;
$this-&amp;gt;applyFilters();&lt;br /&gt;
$this-&amp;gt;restoreLatexValues();&lt;br /&gt;
$this-&amp;gt;insertPlaceHolders();&lt;br /&gt;
$this-&amp;gt;strin = str_replace('$ !html[','!html[',$this-&amp;gt;strin); //another modification. Stops &amp;lt;html&amp;gt; tags from being given $ tags and therefore breaking tth&lt;br /&gt;
$this-&amp;gt;strin = str_replace(']! $',']!',$this-&amp;gt;strin); //bug occurs when maxima returns &amp;lt;html&amp;gt;tags in output, eg plots or div by 0 errors&lt;br /&gt;
$this-&amp;gt; JSMath_LaTeXtoHTML();&lt;br /&gt;
//BEGIN CHANGE&lt;br /&gt;
$trigin = array("sin^{-1}", "cos^{-1}", "tan^{-1}");&lt;br /&gt;
$trigout = array("arcsin", "arccos", "arctan");&lt;br /&gt;
$this-&amp;gt;mathmlString = str_replace($trigin, $trigout, $this-&amp;gt;strin);&lt;br /&gt;
//END CHANGE&lt;br /&gt;
$this-&amp;gt;mathmlString =  $this-&amp;gt;strin;&lt;/p&gt;
&lt;p&gt;$this-&amp;gt;restoreHTML();&lt;br /&gt;
$this-&amp;gt;restoreFeedback();&lt;br /&gt;
$this-&amp;gt;restorePRTFeedback();&lt;br /&gt;
}&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>