From 81037e5d10b9e8ff05e4ed6d875284216dfe10ff Mon Sep 17 00:00:00 2001 From: Christian Abdelmassih Date: Sat, 19 Aug 2017 19:29:35 +0200 Subject: [PATCH] Add latin-1 letters as math symbols (#796) Additional work is required to render them using Computer Modern, currently we use the fallback font which is Times New Roman. --- src/symbols.js | 3 +++ test/unicode-spec.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/symbols.js b/src/symbols.js index 192ed744..0cda21ce 100644 --- a/src/symbols.js +++ b/src/symbols.js @@ -671,16 +671,19 @@ for (let i = 0; i < letters.length; i++) { // Latin-1 letters for (let i = 0x00C0; i <= 0x00D6; i++) { const ch = String.fromCharCode(i); + defineSymbol(math, main, mathord, ch, ch); defineSymbol(text, main, textord, ch, ch); } for (let i = 0x00D8; i <= 0x00F6; i++) { const ch = String.fromCharCode(i); + defineSymbol(math, main, mathord, ch, ch); defineSymbol(text, main, textord, ch, ch); } for (let i = 0x00F8; i <= 0x00FF; i++) { const ch = String.fromCharCode(i); + defineSymbol(math, main, mathord, ch, ch); defineSymbol(text, main, textord, ch, ch); } diff --git a/test/unicode-spec.js b/test/unicode-spec.js index dca0b873..6037ec84 100644 --- a/test/unicode-spec.js +++ b/test/unicode-spec.js @@ -70,8 +70,8 @@ describe("unicode", function() { expect('\\text{ÀàÇçÉéÏïÖöÛû}').toParse(); }); - it("should not parse Latin-1 outside \\text{}", function() { - expect('ÀàÇçÉéÏïÖöÛû').toNotParse(); + it("should parse Latin-1 outside \\text{}", function() { + expect('ÀàÇçÉéÏïÖöÛû').toParse(); }); it("should parse Cyrillic inside \\text{}", function() {