diff --git a/src/main/scala/com/github/tomtung/latex2unicode/helper/Escape.scala b/src/main/scala/com/github/tomtung/latex2unicode/helper/Escape.scala index 9f3fee7..c2b4dae 100644 --- a/src/main/scala/com/github/tomtung/latex2unicode/helper/Escape.scala +++ b/src/main/scala/com/github/tomtung/latex2unicode/helper/Escape.scala @@ -163,6 +163,7 @@ object Escape { "\\rightharpoonup" -> "⇀", "\\rightharpoondown" -> "⇁", "\\rightarrowtail" -> "↣", + "\\to" -> "→", "\\rightarrow" -> "→", "\\rhd" -> "⊳", "\\rfloor" -> "⌋", @@ -232,6 +233,7 @@ object Escape { "\\leftharpoonup" -> "↼", "\\leftharpoondown" -> "↽", "\\leftarrowtail" -> "↢", + "\\gets" -> "←", "\\leftarrow" -> "←", "\\leadsto" -> "↝", "\\le" -> "≤", @@ -374,6 +376,7 @@ object Escape { "\\Re" -> "ℜ", "\\Lsh" -> "↰", "\\Longrightarrow" -> "⇒", + "\\iff" -> "⇔", "\\Longleftrightarrow" -> "⇔", "\\Longleftarrow" -> "⇐", "\\Lleftarrow" -> "⇚", diff --git a/src/test/scala/com/github/tomtung/latex2unicode/Latex2UnicodeTest.scala b/src/test/scala/com/github/tomtung/latex2unicode/Latex2UnicodeTest.scala index add08b4..4eebfaa 100644 --- a/src/test/scala/com/github/tomtung/latex2unicode/Latex2UnicodeTest.scala +++ b/src/test/scala/com/github/tomtung/latex2unicode/Latex2UnicodeTest.scala @@ -44,6 +44,12 @@ class LaTeX2UnicodeTest extends AnyFunSuite { ) shouldBe "5−1 is between 1–10—obviously. ----anonymous" } + test("ams arrows") { + LaTeX2Unicode.convert("\\to") shouldBe "→" + LaTeX2Unicode.convert("\\gets") shouldBe "←" + LaTeX2Unicode.convert("\\iff") shouldBe "⇔" + } + test("Subscript") { LaTeX2Unicode.convert("i_{}") shouldBe "i" LaTeX2Unicode.convert("i_123") shouldBe "i₁23"