5.2 Unary Op

The ‘mo-unary’ is established in the first pass over inline-math, so we need to wait for the second pass with the following.

<..eliminate inline math narrative NO 2..>
 <xsl:template match="span[
     (@class = ’inline-math’)
   and
     (count( <.math content element.> ) = 2)
   and
     (  child::mo[
           (@class = ’mo-unary’)
         and
           following-sibling::*[1]
           / self::mi
        ]
       or
        child::mi[
           following-sibling::*[1]
           [ (@class = ’MathClass-open-close’)
             and
             not(child::*[2]
                 / child::*[ not(self::BREAK) ]
                 / child::*[ not(self::BREAK) ] )
        ]  ]
     )
 ]" >
   <xsl:copy>
     <xsl:choose>
        <.when func on shallow arg.>
        <xsl:otherwise>
           <.unary op on short content.>
        </xsl:otherwise>
     </xsl:choose>
   </xsl:copy>
 </xsl:template>
-_-_-

<..when func on shallow arg..>
 <xsl:when test="
    child::mrow[ @class = ’MathClass-open-close’ ]
 " >
    <xsl:attribute name="class">
       <xsl:text>semi-math</xsl:text>
    </xsl:attribute>
    <PROS PITCH="-5">
    <BREAK SIZE="small"/>
       <xsl:apply-templates
               select="<.math content element.>" />
    <BREAK SIZE="small"/>
    </PROS>
 </xsl:when>
-_-_-

<..unary op on short content..>
 <xsl:attribute name="class">
    <xsl:text>semi-math</xsl:text>
 </xsl:attribute>
 <PROS PITCH="-5">
 <BREAK SIZE="small"/>
    <xsl:apply-templates
            select="<.math content element.>" />
 <BREAK SIZE="small"/>
 </PROS>
-_-_-