From 684df05a86989d56796f85cb24ce0516bc19258a Mon Sep 17 00:00:00 2001 From: Erik Demaine Date: Wed, 31 Jan 2018 19:48:23 -0500 Subject: [PATCH] Add support for \mathring (#1125) Fix #1124. \mathring is the math-mode equivalent to the \r accent. Support follows from a rather trivial symbol aliasing, plus (for Unicode support) listing it in `unicodeAccents.js`. --- src/functions/accent.js | 4 ++-- src/symbols.js | 1 + src/unicodeAccents.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/functions/accent.js b/src/functions/accent.js index 7b840c79..0388dea6 100644 --- a/src/functions/accent.js +++ b/src/functions/accent.js @@ -174,7 +174,7 @@ const mathmlBuilder = (group, options) => { const NON_STRETCHY_ACCENT_REGEX = new RegExp([ "\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", - "\\check", "\\hat", "\\vec", "\\dot", + "\\check", "\\hat", "\\vec", "\\dot", "\\mathring", ].map(accent => `\\${accent}`).join("|")); // Accents @@ -182,7 +182,7 @@ defineFunction({ type: "accent", names: [ "\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", - "\\check", "\\hat", "\\vec", "\\dot", + "\\check", "\\hat", "\\vec", "\\dot", "\\mathring", "\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow", "\\Overrightarrow", "\\overleftrightarrow", "\\overgroup", "\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon", diff --git a/src/symbols.js b/src/symbols.js index 4bb9053e..3d82fe63 100644 --- a/src/symbols.js +++ b/src/symbols.js @@ -646,6 +646,7 @@ defineSymbol(math, main, accent, "\u02c7", "\\check"); defineSymbol(math, main, accent, "\u005e", "\\hat"); defineSymbol(math, main, accent, "\u20d7", "\\vec"); defineSymbol(math, main, accent, "\u02d9", "\\dot"); +defineSymbol(math, main, accent, "\u02da", "\\mathring"); defineSymbol(math, main, mathord, "\u0131", "\\imath", true); defineSymbol(math, main, mathord, "\u0237", "\\jmath", true); defineSymbol(text, main, textord, "\u0131", "\\i", true); diff --git a/src/unicodeAccents.js b/src/unicodeAccents.js index 4d217dc6..64808884 100644 --- a/src/unicodeAccents.js +++ b/src/unicodeAccents.js @@ -13,6 +13,6 @@ module.exports = { '\u030c': {text: '\\v', math: '\\check'}, '\u0302': {text: '\\^', math: '\\hat'}, '\u0307': {text: '\\.', math: '\\dot'}, - '\u030a': {text: '\\r'}, + '\u030a': {text: '\\r', math: '\\mathring'}, '\u030b': {text: '\\H'}, };