Skip to content

Commit ec0d983

Browse files
authored
Merge pull request #3 from oreillymedia/improve-operator-tagging
Improve operator tagging
2 parents f8ecfc6 + aec6829 commit ec0d983

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

latex2mathml/converter.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@
3131
r">",
3232
r"<",
3333
r".",
34+
r"\ast",
3435
r"\bigotimes",
36+
r"\cdot",
3537
r"\centerdot",
38+
r"\div",
3639
r"\dots",
3740
r"\dotsc",
3841
r"\dotso",
@@ -51,6 +54,7 @@
5154
r"\smallint",
5255
r"\smallsmile",
5356
r"\surd",
57+
r"\times",
5458
r"\varsubsetneqq",
5559
r"\varsupsetneqq",
5660
)

tests/test_converter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
pytest.param("12x", MultiDict([("mn", "12"), ("mi", "x")]), id="numbers-and-identifiers"),
2020
pytest.param("+", {"mo": "&#x0002B;"}, id="single-operator"),
2121
pytest.param("3-2", MultiDict([("mn", "3"), ("mo", "&#x02212;"), ("mn", "2")]), id="numbers-and-operators"),
22+
pytest.param(r"3 \times 2", MultiDict([("mn", "3"), ("mo", "&#x000D7;"), ("mn", "2")]), id="numbers-and-operators-times"),
23+
pytest.param(r"3 \cdot 2", MultiDict([("mn", "3"), ("mo", "&#x000B7;"), ("mn", "2")]), id="numbers-and-operators-cdot"),
24+
pytest.param(r"3 \div 2", MultiDict([("mn", "3"), ("mo", "&#x000F7;"), ("mn", "2")]), id="numbers-and-operators-div"),
2225
pytest.param(
2326
"3x*2",
2427
MultiDict([("mn", "3"), ("mi", "x"), ("mo", "&#x0002A;"), ("mn", "2")]),

0 commit comments

Comments
 (0)