<?xml version='1.0' encoding=“UTF-8”?> <xsl:stylesheet xmlns:xsl=“www.w3.org/1999/XSL/Transform”
xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:inst="http://instructure.com/functions" extension-element-prefixes="inst" version='1.0'> <xsl:template match="m:munder"> <xsl:call-template name="munder"> <xsl:with-param name="base"> <xsl:call-template name="startspace"> <xsl:with-param name="symbol" select="./*[1]"/> </xsl:call-template> </xsl:with-param> <xsl:with-param name="under"> <xsl:call-template name="startspace"> <xsl:with-param name="symbol" select="./*[2]"/> </xsl:call-template> </xsl:with-param> </xsl:call-template> </xsl:template> <xsl:template name="munder"> <xsl:param name="base"/> <xsl:param name="under"/> <xsl:variable name="diacritics-regex" select="'^[̀-̸⃐-⃯]$'" /> <xsl:variable name="is-diacritical-mark" select="inst:matches($under, $diacritics-regex)" /> <!-- original: scripts.xsl line 128 --> <!-- modified based on: mml2tex.xsl line 312 --> <xsl:choose> <xsl:when test="translate($base,'∏∐⋂⋃⊔', '∑∑∑∑∑')='∑'"> <!-- if $base is operator, such as ∑ /sum L: summation operator ∏ /prod L: product operator ∐ /coprod L: coproduct operator ⋂ /bigcap ⋃ /bigcup ⊔ /bigsqcup --> <xsl:apply-templates select="./*[1]"/> <xsl:text>_{</xsl:text> <xsl:apply-templates select="./*[2]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$under = '⏞' or $under = '⏟'"> <xsl:text>\underbrace</xsl:text> </xsl:when> <xsl:when test="$under = '⎴' or $under = '⎵'"> <xsl:text>\underbracket</xsl:text> </xsl:when> <xsl:when test="inst:matches($under, '^[¯_̄̅‾]$')"><!-- macron, combining macron, combining overline --> <xsl:text>\underline</xsl:text> </xsl:when> <xsl:when test="$is-diacritical-mark"> <xsl:apply-templates select="./*[2]"/> </xsl:when> <xsl:otherwise> <xsl:text>\underset{</xsl:text> <xsl:apply-templates select="./*[2]"/> <xsl:text>}</xsl:text> </xsl:otherwise> </xsl:choose> <xsl:text>{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template>
</xsl:stylesheet>