Server IP : 195.201.23.43 / Your IP : 3.148.196.9 Web Server : Apache System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 User : kdecoratie ( 1041) PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/root/lib/libreoffice/share/extensions/wiki-publisher/filter/math/ |
Upload File : |
<?xml version='1.0' encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:oomath="http://www.w3.org/1998/Math/MathML" version='1.0'> <!-- ====================================================================== --> <!-- $Id: scripts.xsl 2755 2008-03-07 20:35:56Z hauma $ This file is part of the XSLT MathML Library distribution. See ./README or http://xsltml.sf.net for copyright and other information --> <!-- ====================================================================== --> <xsl:template match="m:munderover"> <xsl:variable name="base" select="translate(./*[1],' ','')"/> <xsl:variable name="under" select="translate(./*[2],' ','')"/> <xsl:variable name="over" select="translate(./*[3],' ','')"/> <xsl:choose> <xsl:when test="$over='¯'"> <!-- OverBar - over bar --> <xsl:text>\overline{</xsl:text> <xsl:call-template name="munder"> <xsl:with-param name="base" select="$base"/> <xsl:with-param name="under" select="$under"/> </xsl:call-template> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='︷' or $over=''"> <!-- OverBrace - over brace --> <xsl:text>\overbrace{</xsl:text> <xsl:call-template name="munder"> <xsl:with-param name="base" select="$base"/> <xsl:with-param name="under" select="$under"/> </xsl:call-template> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='←'"> <!--/leftarrow /gets A: =leftward arrow --> <xsl:text>\overleftarrow{</xsl:text> <xsl:call-template name="munder"> <xsl:with-param name="base" select="$base"/> <xsl:with-param name="under" select="$under"/> </xsl:call-template> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='→'"> <!--/rightarrow /to A: =rightward arrow --> <xsl:text>\overrightarrow{</xsl:text> <xsl:call-template name="munder"> <xsl:with-param name="base" select="$base"/> <xsl:with-param name="under" select="$under"/> </xsl:call-template> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='↔'"> <!--/leftrightarrow A: l&r arrow --> <xsl:text>\overleftrightarrow{</xsl:text> <xsl:call-template name="munder"> <xsl:with-param name="base" select="$base"/> <xsl:with-param name="under" select="$under"/> </xsl:call-template> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$under='̲'"> <!-- UnderBar - combining low line --> <xsl:text>\underline{</xsl:text> <xsl:call-template name="mover"> <xsl:with-param name="base" select="$base"/> <xsl:with-param name="over" select="$over"/> <xsl:with-param name="pos_over" select="3"/> </xsl:call-template> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$under='︸' or $under=''"> <!-- UnderBrace - under brace --> <xsl:text>\underbrace{</xsl:text> <xsl:call-template name="mover"> <xsl:with-param name="base" select="$base"/> <xsl:with-param name="over" select="$over"/> <xsl:with-param name="pos_over" select="3"/> </xsl:call-template> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$under='←'"> <!--/leftarrow /gets A: =leftward arrow --> <xsl:text>\underleftarrow{</xsl:text> <xsl:call-template name="mover"> <xsl:with-param name="base" select="$base"/> <xsl:with-param name="over" select="$over"/> <xsl:with-param name="pos_over" select="3"/> </xsl:call-template> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$under='→'"> <!--/rightarrow /to A: =rightward arrow --> <xsl:text>\underrightarrow{</xsl:text> <xsl:call-template name="mover"> <xsl:with-param name="base" select="$base"/> <xsl:with-param name="over" select="$over"/> <xsl:with-param name="pos_over" select="3"/> </xsl:call-template> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$under='↔'"> <!--/leftrightarrow A: l&r arrow --> <xsl:text>\underleftrightarrow{</xsl:text> <xsl:call-template name="mover"> <xsl:with-param name="base" select="$base"/> <xsl:with-param name="over" select="$over"/> <xsl:with-param name="pos_over" select="3"/> </xsl:call-template> <xsl:text>}</xsl:text> </xsl:when> <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:apply-templates select="./*[3]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>\underset{</xsl:text> <xsl:apply-templates select="./*[2]"/> <xsl:text>}{\overset{</xsl:text> <xsl:apply-templates select="./*[3]"/> <xsl:text>}{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}}</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="m:mover"> <xsl:call-template name="mover"> <xsl:with-param name="base" select="translate(./*[1],' ','')"/> <xsl:with-param name="over" select="translate(./*[2],' ','')"/> </xsl:call-template> </xsl:template> <xsl:template match="m:munder"> <xsl:call-template name="munder"> <xsl:with-param name="base" select="translate(./*[1],' ','')"/> <xsl:with-param name="under" select="translate(./*[2],' ','')"/> </xsl:call-template> </xsl:template> <xsl:template name="mover"> <xsl:param name="base"/> <xsl:param name="over"/> <xsl:param name="pos_over" select="2"/> <xsl:choose> <xsl:when test="$over='¯'"> <!-- OverBar - over bar --> <xsl:text>\overline{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='︷' or $over=''"> <!-- OverBrace - over brace --> <xsl:text>\overbrace{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='←'"> <!--/leftarrow /gets A: =leftward arrow --> <xsl:text>\overleftarrow{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='→'"> <!--/rightarrow /to A: =rightward arrow --> <xsl:text>\overrightarrow{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='↔'"> <!--/leftrightarrow A: l&r arrow --> <xsl:text>\overleftrightarrow{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='˜'"> <!-- small tilde --> <xsl:text>\tilde{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='✓'"> <!-- /checkmark =tick, check mark --> <xsl:text>\check{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='˙'"> <!-- dot above --> <xsl:text>\dot{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='¨'"> <!-- DoubleDot - dieresis or umlaut mark --> <xsl:text>\ddot{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='´'"> <!-- Acute accent "´" --> <xsl:text>\acute{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='`'"> <!-- Grave accent "`" --> <xsl:text>\grave{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='ˇ'"> <!-- Caron (Mandarin Chinese third tone) "ˇ" --> <xsl:text>\check{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='˘'"> <!-- Breve accent "˘" --> <xsl:text>\breve{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='˚'"> <!-- ring above "˚" --> <xsl:text>\overset{\circ}{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='ˉ'"> <!-- modifier letter Macron (Mandarin Chinese first tone) "ˉ" --> <xsl:text>\bar{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='¨'"> <!-- Diaeresis "¨" --> <xsl:text>\ddot{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='⃗'"> <!-- Vector --> <xsl:text>\vec{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$over='̂' or $over='^' or $over='ˆ'"> <!-- Hat or circ - circumflex accent --> <xsl:choose> <xsl:when test="@oomath:accent='true'"> <xsl:text>\widehat{</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>\hat{</xsl:text> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="./*[1]"/><xsl:text>}</xsl:text> </xsl:when> <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="./*[$pos_over]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>\stackrel{</xsl:text> <xsl:apply-templates select="./*[$pos_over]"/> <xsl:text>}{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> <!-- <xsl:text>\overset{</xsl:text> <xsl:apply-templates select="./*[$pos_over]"/> <xsl:text>}{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text>--> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="munder"> <xsl:param name="base"/> <xsl:param name="under"/> <xsl:choose> <xsl:when test="$under='̲'"> <!-- UnderBar - combining low line --> <xsl:text>\underline{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$under='︸' or $under=''"> <!-- UnderBrace - under brace --> <xsl:text>\underbrace{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$under='←'"> <!--/leftarrow /gets A: =leftward arrow --> <xsl:text>\underleftarrow{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$under='→'"> <!--/rightarrow /to A: =rightward arrow --> <xsl:text>\underrightarrow{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <xsl:when test="$under='↔'"> <!--/leftrightarrow A: l&r arrow --> <xsl:text>\underleftrightarrow{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:when> <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:text>\underset{</xsl:text> <!-- Required AmsMath package --> <xsl:apply-templates select="./*[2]"/> <xsl:text>}{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="m:msubsup"> <xsl:text>{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}_{</xsl:text> <xsl:apply-templates select="./*[2]"/> <xsl:text>}^{</xsl:text> <xsl:apply-templates select="./*[3]"/> <xsl:text>}</xsl:text> </xsl:template> <xsl:template match="m:msup"> <xsl:text>{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}^{</xsl:text> <xsl:apply-templates select="./*[2]"/> <xsl:text>}</xsl:text> </xsl:template> <xsl:template match="m:msub"> <xsl:text>{</xsl:text> <xsl:apply-templates select="./*[1]"/> <xsl:text>}_{</xsl:text> <xsl:apply-templates select="./*[2]"/> <xsl:text>}</xsl:text> </xsl:template> <xsl:template match="m:mmultiscripts" mode="mprescripts"> <xsl:for-each select="m:mprescripts/following-sibling::*"> <xsl:if test="position() mod 2 and local-name(.)!='none'"> <xsl:text>{}_{</xsl:text> <xsl:apply-templates select="."/> <xsl:text>}</xsl:text> </xsl:if> <xsl:if test="not(position() mod 2) and local-name(.)!='none'"> <xsl:text>{}^{</xsl:text> <xsl:apply-templates select="."/> <xsl:text>}</xsl:text> </xsl:if> </xsl:for-each> <xsl:apply-templates select="./*[1]"/> <xsl:for-each select="m:mprescripts/preceding-sibling::*[position()!=last()]"> <xsl:if test="position()>2 and local-name(.)!='none'"> <xsl:text>{}</xsl:text> </xsl:if> <xsl:if test="position() mod 2 and local-name(.)!='none'"> <xsl:text>_{</xsl:text> <xsl:apply-templates select="."/> <xsl:text>}</xsl:text> </xsl:if> <xsl:if test="not(position() mod 2) and local-name(.)!='none'"> <xsl:text>^{</xsl:text> <xsl:apply-templates select="."/> <xsl:text>}</xsl:text> </xsl:if> </xsl:for-each> </xsl:template> <xsl:template match="m:mmultiscripts"> <xsl:choose> <xsl:when test="m:mprescripts"> <xsl:apply-templates select="." mode="mprescripts"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="./*[1]"/> <xsl:for-each select="*[position()>1]"> <xsl:if test="position()>2 and local-name(.)!='none'"> <xsl:text>{}</xsl:text> </xsl:if> <xsl:if test="position() mod 2 and local-name(.)!='none'"> <xsl:text>_{</xsl:text> <xsl:apply-templates select="."/> <xsl:text>}</xsl:text> </xsl:if> <xsl:if test="not(position() mod 2) and local-name(.)!='none'"> <xsl:text>^{</xsl:text> <xsl:apply-templates select="."/> <xsl:text>}</xsl:text> </xsl:if> </xsl:for-each> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet>Private