Skip to content

Commit

Permalink
[ci skip] add missing unicode entities
Browse files Browse the repository at this point in the history
  • Loading branch information
belerico committed Apr 12, 2020
1 parent e455ddc commit 2af4d2c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include LICENSE
include README.md
recursive-include py_asciimath/dtd/ *
recursive-include py_asciimath/dtd/ *
recursive-include py_asciimath/translation/mathml2tex/ *
4 changes: 2 additions & 2 deletions py_asciimath/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ def get_symbols_for(symbol_group, translation): # pragma: no cover

operation_symbols = {
'"+"': {"latex": "+", "mathml": "+"},
'"*"': {"latex": "\\cdot", "mathml": "⋅"},
'"*"': {"latex": "\\cdot", "mathml": "⋅"},
'"-"': {"latex": "-", "mathml": "-"},
'"cdot"': {"latex": "\\cdot", "mathml": "·"},
'"cdot"': {"latex": "\\cdot", "mathml": "⋅"},
'"**"': {"latex": "\\ast", "mathml": "*"},
'"ast"': {"latex": "\\ast", "mathml": "*"},
'"***"': {"latex": "\\star", "mathml": "⋆"},
Expand Down
30 changes: 29 additions & 1 deletion py_asciimath/translation/mathml2tex/entities.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,39 @@
<xsl:when test="starts-with($content,'&#x021D1;')"><xsl:value-of select="'\Uparrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x021D1;')"/></xsl:call-template></xsl:when> <!--/Uparrow A: up dbl arrow -->
<xsl:when test="starts-with($content,'&#x021D2;')"><xsl:value-of select="'\Rightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x021D2;')"/></xsl:call-template></xsl:when> <!--/Rightarrow A: implies -->
<xsl:when test="starts-with($content,'&#x021D3;')"><xsl:value-of select="'\Downarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x021D3;')"/></xsl:call-template></xsl:when> <!--/Downarrow A: down dbl arrow -->
<!-- <xsl:when test="starts-with($content,'&#x021D4;')"><xsl:value-of select="'\Leftrightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x021D4;')"/></xsl:call-template></xsl:when> /Leftrightarrow A: l&r dbl arrow -->
<xsl:when test="starts-with($content,'&#x021D4;')"><xsl:value-of select="'\Leftrightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x021D4;')"/></xsl:call-template></xsl:when> <!--/Leftrightarrow A: l&r dbl arrow-->
<xsl:when test="starts-with($content,'&#x021D4;')"><xsl:value-of select="'\iff '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x021D4;')"/></xsl:call-template></xsl:when> <!--/iff if and only if -->
<xsl:when test="starts-with($content,'&#x021D5;')"><xsl:value-of select="'\Updownarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x021D5;')"/></xsl:call-template></xsl:when> <!--/Updownarrow A: up&down dbl arrow -->
<xsl:when test="starts-with($content,'&#x021DA;')"><xsl:value-of select="'\Lleftarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x021DA;')"/></xsl:call-template></xsl:when> <!--/Lleftarrow A: left triple arrow --> <!-- Required amssymb -->
<xsl:when test="starts-with($content,'&#x021DB;')"><xsl:value-of select="'\Rrightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x021DB;')"/></xsl:call-template></xsl:when> <!--/Rrightarrow A: right triple arrow --> <!-- Required amssymb -->
<xsl:when test="starts-with($content,'&#x02916;')"><xsl:value-of select="'\twoheadrightarrowtail '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x02916;')"/></xsl:call-template></xsl:when> <!--right two-headed arrow with tail --> <!-- Required amssymb -->


<!-- ====================================================================== -->
<!-- MISSING UNICODE -->
<!-- ====================================================================== -->

<xsl:when test="starts-with($content,'&#x02192;')"><xsl:value-of select="'\rightarrow '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x02192;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x02308;')"><xsl:value-of select="'\lceiling '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x02308;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x02309;')"><xsl:value-of select="'\rceiling '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x02309;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x025b3;')"><xsl:value-of select="'\triangle '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x025b3;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x021d2;')"><xsl:value-of select="'\implies '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x021d2;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x022c9;')"><xsl:value-of select="'\ltimes '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x022c9;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x02aaf;')"><xsl:value-of select="'\preceq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x02aaf;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x022ca;')"><xsl:value-of select="'\rtimes '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x022ca;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x02ab0;')"><xsl:value-of select="'\succeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x02ab0;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x02322;')"><xsl:value-of select="'\frown '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x02322;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x022ee;')"><xsl:value-of select="'\vdots '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x022ee;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x000a0;')"><xsl:value-of select="'\quad '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x000a0;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x02aaf;')"><xsl:value-of select="'\preceq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x02aaf;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x02227;')"><xsl:value-of select="'\mathmr{and} '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x02227;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x022a5;')"><xsl:value-of select="'\bot '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x022a5;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x000f7;')"><xsl:value-of select="'\div '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x000f7;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x021d2;')"><xsl:value-of select="'\implies '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x021d2;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x02102;')"><xsl:value-of select="'\mathbb{C} '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x02102;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x0211d;')"><xsl:value-of select="'\mathbb{R} '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x0211d;')"/></xsl:call-template></xsl:when>
<xsl:when test="starts-with($content,'&#x02228;')"><xsl:value-of select="'\mathmr{and} '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '&#x02228;')"/></xsl:call-template></xsl:when>


<!-- ====================================================================== -->
<!-- Unicode 3.2
Expand Down
2 changes: 0 additions & 2 deletions py_asciimath/utils/MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ deps =
coverage
commands =
python setup.py develop
coverage run --source py_asciimath --omit py_asciimath/__main__.py,py_asciimath/py_asciimath.py,py_asciimath/parser/parse_lists.py -m unittest discover tests
coverage run --source py_asciimath --omit py_asciimath/const.py,py_asciimath/__main__.py,py_asciimath/py_asciimath.py,py_asciimath/parser/parse_lists.py -m unittest discover tests
coverage report --fail-under 80 -m

0 comments on commit 2af4d2c

Please sign in to comment.