⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pmml2svg-workinprogress.txt

📁 convert MATHML to SVG
💻 TXT
📖 第 1 页 / 共 2 页
字号:
  <!-- ###########################################################################  munder (formatting)  ################################################################################ --><!--  <xsl:template match="math:munder" mode="formatting">    <xsl:param name="size"/>    <xsl:param name="x"/>        <xsl:param name="y"/>        <xsl:param name="baseline" select="0"/>    <xsl:variable name="child1">      <xsl:apply-templates select="math:*[1]" mode="formatting">        <xsl:with-param name="size" select="$size * $sizeMult"/>        <xsl:with-param name="x" select="$x"/>        <xsl:with-param name="y" select="$y"/>      </xsl:apply-templates>    </xsl:variable>    <xsl:variable name="child2">      <xsl:apply-templates select="math:*[2]" mode="formatting">        <xsl:with-param name="size" select="$size * $sizeMult"/>        <xsl:with-param name="x" select="$x"/>        <xsl:with-param name="y" select="$y"/>      </xsl:apply-templates>    </xsl:variable>    <xsl:variable name="numWidth">      <xsl:value-of select="$child1/*/@t:WIDTH"/>    </xsl:variable>    <xsl:variable name="denWidth">      <xsl:value-of select="$child2/*/@t:WIDTH"/>    </xsl:variable>    <xsl:variable name="numHeight">      <xsl:value-of select="$child1/*/@t:HEIGHT"/>    </xsl:variable>    <xsl:variable name="denHeight">      <xsl:value-of select="$child2/*/@t:HEIGHT"/>    </xsl:variable>    <xsl:message>numerator width / height : <xsl:value-of select="$child1/*/@t:WIDTH"/> -        <xsl:value-of select="$child1/*/@t:HEIGHT"/>    </xsl:message>    <xsl:message>denominator width / height : <xsl:value-of select="$child2/*/@t:WIDTH"/> -        <xsl:value-of select="$child2/*/@t:HEIGHT"/>    </xsl:message>    <xsl:variable name="maxWidth">      <xsl:choose>        <xsl:when test="number($numWidth) &lt; number($denWidth)">          <xsl:value-of select="$denWidth * 1.3"/>        </xsl:when>        <xsl:otherwise>          <xsl:value-of select="$numWidth * 1.3"/>        </xsl:otherwise>      </xsl:choose>    </xsl:variable>    <xsl:variable name="centering" select="($maxWidth - ($maxWidth * (10 div 13))) div 2"/>    <xsl:variable name="denX">      <xsl:choose>        <xsl:when test="number($numWidth) &gt; number($denWidth)">          <xsl:value-of select="$centering + ((number($numWidth) - number($denWidth)) div 2)"/>        </xsl:when>        <xsl:otherwise>          <xsl:value-of select="$centering"/>        </xsl:otherwise>      </xsl:choose>    </xsl:variable>    <xsl:variable name="numX">      <xsl:choose>        <xsl:when test="number($numWidth) &lt; number($denWidth)">          <xsl:value-of select="$centering + ((number($denWidth) - number($numWidth)) div 2)"/>        </xsl:when>        <xsl:otherwise>          <xsl:value-of select="$centering"/>        </xsl:otherwise>      </xsl:choose>    </xsl:variable>    <xsl:message>      <xsl:value-of select="$numWidth"/> &lt; <xsl:value-of select="$denWidth"/>    </xsl:message>    <xsl:message>maxWidth: <xsl:value-of select="$maxWidth"/>    </xsl:message>    <xsl:variable name="denY" select="$numHeight + $numHeightDen"/>    <xsl:copy>      <xsl:copy-of select="@*"/>      <xsl:attribute name="t:X">        <xsl:value-of select="$x"/>      </xsl:attribute>      <xsl:attribute name="t:Y">        <xsl:value-of select="$y"/>      </xsl:attribute>      <xsl:attribute name="t:numX">        <xsl:value-of select="$numX"/>      </xsl:attribute>      <xsl:attribute name="t:numHeight">        <xsl:value-of select="$numHeight"/>      </xsl:attribute>      <xsl:message>numHeight : <xsl:value-of select="$numHeight"/>      </xsl:message>      <xsl:attribute name="t:denX">        <xsl:value-of select="$denX"/>      </xsl:attribute>      <xsl:attribute name="t:denY">        <xsl:value-of select="$denY"/>      </xsl:attribute>      <xsl:attribute name="t:FONTSIZE">        <xsl:value-of select="$size"/>      </xsl:attribute>      <xsl:attribute name="t:WIDTH">        <xsl:value-of select="$maxWidth"/>      </xsl:attribute>      <xsl:attribute name="t:HEIGHT">        <xsl:value-of select="$numHeight + $denHeight + $numHeightDen"/>      </xsl:attribute>      <xsl:attribute name="t:BASELINE">        <xsl:value-of select="$y + $numHeight + $denHeight + $numHeightDen"/>      </xsl:attribute>      <xsl:message>        <xsl:value-of select="$numHeight + $denHeight + $numHeightDen"/>      </xsl:message>      <xsl:attribute name="t:TEXT">        <xsl:copy-of select="text()"/>      </xsl:attribute>      <xsl:copy-of select="$child1"/>      <xsl:copy-of select="$child2"/>    </xsl:copy>  </xsl:template>-->  <!-- ###########################################################################  mover(formatting)  ################################################################################ --> <!-- <xsl:template match="math:mover" mode="formatting">    <xsl:param name="size"/>    <xsl:param name="x"/>        <xsl:param name="y"/>        <xsl:param name="baseline" select="0"/>    <xsl:variable name="child1">      <xsl:apply-templates select="math:*[2]" mode="formatting">        <xsl:with-param name="size" select="$size * $sizeMult"/>        <xsl:with-param name="x" select="$x"/>        <xsl:with-param name="y" select="$y"/>      </xsl:apply-templates>    </xsl:variable>    <xsl:variable name="child2">      <xsl:apply-templates select="math:*[1]" mode="formatting">        <xsl:with-param name="size" select="$size * $sizeMult"/>        <xsl:with-param name="x" select="$x"/>        <xsl:with-param name="y" select="$y"/>      </xsl:apply-templates>    </xsl:variable>    <xsl:variable name="numWidth">      <xsl:value-of select="$child1/*/@t:WIDTH"/>    </xsl:variable>    <xsl:variable name="denWidth">      <xsl:value-of select="$child2/*/@t:WIDTH"/>    </xsl:variable>    <xsl:variable name="numHeight">      <xsl:value-of select="$child1/*/@t:HEIGHT"/>    </xsl:variable>    <xsl:variable name="denHeight">      <xsl:value-of select="$child2/*/@t:HEIGHT"/>    </xsl:variable>    <xsl:message>numerator width / height : <xsl:value-of select="$child1/*/@t:WIDTH"/> -        <xsl:value-of select="$child1/*/@t:HEIGHT"/>    </xsl:message>    <xsl:message>denominator width / height : <xsl:value-of select="$child2/*/@t:WIDTH"/> -        <xsl:value-of select="$child2/*/@t:HEIGHT"/>    </xsl:message>    <xsl:variable name="maxWidth">      <xsl:choose>        <xsl:when test="number($numWidth) &lt; number($denWidth)">          <xsl:value-of select="$denWidth * 1.3"/>        </xsl:when>        <xsl:otherwise>          <xsl:value-of select="$numWidth * 1.3"/>        </xsl:otherwise>      </xsl:choose>    </xsl:variable>    <xsl:variable name="centering" select="($maxWidth - ($maxWidth * (10 div 13))) div 2"/>    <xsl:variable name="denX">      <xsl:choose>        <xsl:when test="number($numWidth) &gt; number($denWidth)">          <xsl:value-of select="$centering + ((number($numWidth) - number($denWidth)) div 2)"/>        </xsl:when>        <xsl:otherwise>          <xsl:value-of select="$centering"/>        </xsl:otherwise>      </xsl:choose>    </xsl:variable>    <xsl:variable name="numX">      <xsl:choose>        <xsl:when test="number($numWidth) &lt; number($denWidth)">          <xsl:value-of select="$centering + ((number($denWidth) - number($numWidth)) div 2)"/>        </xsl:when>        <xsl:otherwise>          <xsl:value-of select="$centering"/>        </xsl:otherwise>      </xsl:choose>    </xsl:variable>    <xsl:message>      <xsl:value-of select="$numWidth"/> &lt; <xsl:value-of select="$denWidth"/>    </xsl:message>    <xsl:message>maxWidth: <xsl:value-of select="$maxWidth"/>    </xsl:message>    <xsl:variable name="denY" select="$numHeight + $numHeightDen"/>    <xsl:copy>      <xsl:copy-of select="@*"/>      <xsl:attribute name="t:X">        <xsl:value-of select="$x"/>      </xsl:attribute>      <xsl:attribute name="t:Y">        <xsl:value-of select="$y"/>      </xsl:attribute>      <xsl:attribute name="t:numX">        <xsl:value-of select="$numX"/>      </xsl:attribute>      <xsl:attribute name="t:numHeight">        <xsl:value-of select="$numHeight"/>      </xsl:attribute>      <xsl:message>numHeight : <xsl:value-of select="$numHeight"/>      </xsl:message>      <xsl:attribute name="t:denX">        <xsl:value-of select="$denX"/>      </xsl:attribute>      <xsl:attribute name="t:denY">        <xsl:value-of select="$denY"/>      </xsl:attribute>      <xsl:attribute name="t:FONTSIZE">        <xsl:value-of select="$size"/>      </xsl:attribute>      <xsl:attribute name="t:WIDTH">        <xsl:value-of select="$maxWidth"/>      </xsl:attribute>      <xsl:attribute name="t:HEIGHT">        <xsl:value-of select="$numHeight + $denHeight + $numHeightDen"/>      </xsl:attribute>      <xsl:message>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -