From 5535d720dc565b7c65642c749b88178bdb280eee Mon Sep 17 00:00:00 2001 From: Ron Kok Date: Wed, 2 May 2018 11:29:57 -0700 Subject: [PATCH] Greek caps (#1283) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Support Greek capital letters Supports Greek letters ΑΒΕΖΗΙΚΜΝΟΡΤΧ. Resolves issue #1282. --- src/macros.js | 15 +++++++++++++++ test/katex-spec.js | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/src/macros.js b/src/macros.js index 38bec39f..0ca781fc 100644 --- a/src/macros.js +++ b/src/macros.js @@ -126,6 +126,21 @@ defineMacro("\u211A", "\\mathbb{Q}"); defineMacro("\u211D", "\\mathbb{R}"); defineMacro("\u2124", "\\mathbb{Z}"); +// Unicode Greek capital letters +defineMacro("\u0391", "A"); +defineMacro("\u0392", "B"); +defineMacro("\u0395", "E"); +defineMacro("\u0396", "Z"); +defineMacro("\u0397", "H"); +defineMacro("\u0399", "I"); +defineMacro("\u039A", "K"); +defineMacro("\u039C", "M"); +defineMacro("\u039D", "N"); +defineMacro("\u039F", "O"); +defineMacro("\u03A1", "P"); +defineMacro("\u03A4", "T"); +defineMacro("\u03A7", "X"); + defineMacro("\u210E", "\\mathit{h}"); // Planck constant // Characters omitted from Unicode range 1D400–1D7FF diff --git a/test/katex-spec.js b/test/katex-spec.js index be873bda..ee32f049 100644 --- a/test/katex-spec.js +++ b/test/katex-spec.js @@ -2991,6 +2991,11 @@ describe("Unicode", function() { expect("£¥ðℂℍℑℓℕ℘ℙℚℜℝℤℲℵℶℷℸ⅁∀∁∂∃∇∞∠∡∢♠♡♢♣♭♮♯✓°\u00b7").toParse(); }); + it("should build Greek capital letters", function() { + expect("\u0391\u0392\u0395\u0396\u0397\u0399\u039A\u039C\u039D" + + "\u039F\u03A1\u03A4\u03A7").toBuild(); + }); + it("should parse arrows", function() { expect("←↑→↓↔↕↖↗↘↙↚↛↞↠↢↣↦↩↪↫↬↭↮↰↱↶↷↼↽↾↾↿⇀⇁⇂⇃⇄⇆⇇⇈⇉").toParse(); });