From f25e08d6187a84be2fce73624fdc124ded5a7879 Mon Sep 17 00:00:00 2001 From: Ron Kok Date: Thu, 3 May 2018 13:58:04 -0700 Subject: [PATCH] =?UTF-8?q?Support=20Unicode=20=E2=89=98=E2=89=99=E2=89=9A?= =?UTF-8?q?=E2=89=9B=E2=89=9D=E2=89=9E=E2=89=9F=20(#1274)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Support Unicode stackrel Supports Unicode characters ≘ ≙ ≚ ≛ ≝ ≞ ≟ * Fix lint error * Delete unnecessary braces --- src/macros.js | 10 ++++++++++ test/katex-spec.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/macros.js b/src/macros.js index 8799d2fe..85f53284 100644 --- a/src/macros.js +++ b/src/macros.js @@ -151,6 +151,16 @@ defineMacro("\\llap", "\\mathllap{\\textrm{#1}}"); defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}"); defineMacro("\\clap", "\\mathclap{\\textrm{#1}}"); +// Unicode stacked relations +defineMacro("\u2258", + "\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}"); +defineMacro("\u2259", "\\stackrel{\\tiny\\wedge}{=}"); +defineMacro("\u225A", "\\stackrel{\\tiny\\vee}{=}"); +defineMacro("\u225B", "\\stackrel{\\scriptsize\\star}{=}"); +defineMacro("\u225D", "\\stackrel{\\tiny\\mathrm{def}}{=}"); +defineMacro("\u225E", "\\stackrel{\\tiny\\mathrm{m}}{=}"); +defineMacro("\u225F", "\\stackrel{\\tiny?}{=}"); + ////////////////////////////////////////////////////////////////////// // amsmath.sty // http://mirrors.concertpass.com/tex-archive/macros/latex/required/amsmath/amsmath.pdf diff --git a/test/katex-spec.js b/test/katex-spec.js index 1830d4fc..2d2cb613 100644 --- a/test/katex-spec.js +++ b/test/katex-spec.js @@ -2982,7 +2982,7 @@ describe("Unicode", function() { }); it("should parse more relations", function() { - expect("⊂⊃⊆⊇⊏⊐⊑⊒⊢⊣⊩⊪⊸⋈⋍⋐⋑⋔⋛⋞⋟⌢⌣⩾⪆⪌⪕⪖⪯⪰⪷⪸⫅⫆").toParse(); + expect("⊂⊃⊆⊇⊏⊐⊑⊒⊢⊣⊩⊪⊸⋈⋍⋐⋑⋔⋛⋞⋟⌢⌣⩾⪆⪌⪕⪖⪯⪰⪷⪸⫅⫆≘≙≚≛≝≞≟").toBuild(); }); it("should parse symbols", function() {