4.7 Numeric Subscripts (Rule 77)

<..compress numeric subscripts..>
   <set name="num-sub" >
      <.open xslt script.>
      <.num sub.>
      <.close xslt script.>
   </set>
   <xslt name="." xml="." xsl="num-sub" />
-_-_-

<..num sub..>
 <xsl:template match="span[
     (@class = ’msub’)
   and
     (count( child::span[ @class = ’mrow-base’ ]
            / child::* ) = 1 )
   and not( ancestor::*[
       (@class = ’msub’)
     or
       (@class = ’msup’)
     or
       (@class = ’msubsup’)
     ] )
   and
     not( child::span[ @class = ’mrow-sub’ ]
            / child::* [
                 not( @title = ’speech-extra’ )
               and
                 not( @class = ’mn’ )
               and
                 not(
                   (@class = ’mo-punc’)
                   and
                   ( . = ’,’ )
                   and
                   preceding-sibling::*[1][ @class = ’mn’ ]
                   and
                   following-sibling::*[1][ @class = ’mn’ ]
                   and
                   following-sibling::*[2][ @class = ’mn’ ]
                   and
                   following-sibling::*[3][ @class = ’mn’ ]
                   and
                   (  not(following-sibling::*[4])
                      or
                      not(following-sibling::*[4][ @class = ’mn’ ])
                   )
                 )
               and
                 not(
                   (@class = ’mo-punc’)
                   and
                   ( . = ’.’ )
                   and
                   following-sibling::*[1][ @class = ’mn’ ]
                   and
                   not(
                     following-sibling::*[
                        (@class = ’mo-punc’)
                      and
                        (. = ’.’)
                     ]
                   )
                 )
           ])
 ]" >
   <xsl:copy>
      <xsl:apply-templates select="@*" />
      <xsl:apply-templates select="*[1]" />
      <span class="mrow-sub">
         <span class="space" title="speech-extra">
            <xsl:text> </xsl:text>
         </span>
         <xsl:apply-templates
            select="*[2] / *[
                     not(@title = ’speech-extra’)
                  and
                     not(
                       (@class = ’mo-punc’)
                       and (. = ’,’)
                     )
           ]" />
      </span>
   </xsl:copy>
 </xsl:template>
-_-_-

Emacspeak doesn’t read fluently numbers with commas. For instance ‘10,000’ is treated as ‘ten comma zero zero zero’.

<span class="msub">  
  <span class="mrow-base">  
    <span class="mi">x</span>  
  </span>  
  <span class="mrow-sub">  
    <span class="begin-script" title="speech-extra"> subscript </span>  
    <span class="mn">1</span>  
    <span class="end-script" title="speech-extra"> baseline </span>  
  </span>  
</span>