From ba84964d6fbe342b70a631dd0a31c43d3752b7bd Mon Sep 17 00:00:00 2001 From: Alex Lopatin Date: Wed, 29 Jan 2014 18:14:12 -0800 Subject: [PATCH] Add \enspace (0.5em space) Summary: TeX spacing is complicated - there's \enskip and \enspace and the two are subtly different in some weird way. But \enspace seems to be the preferred half em space in LaTeX, and the only one which MathJax supports. Test Plan: Parsed and rendered correctly. Reviewers: alpert Reviewed By: alpert Differential Revision: http://phabricator.khanacademy.org/D6437 --- Parser.js | 1 + buildTree.js | 1 + static/katex.less | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/Parser.js b/Parser.js index fdce97e..6e5d3dc 100644 --- a/Parser.js +++ b/Parser.js @@ -294,6 +294,7 @@ var copyFuncs = { "\\,", "\\:", "\\;", + "\\enspace", "\\qquad", "\\quad", "\\space" diff --git a/buildTree.js b/buildTree.js index e05bd70..eeca16f 100644 --- a/buildTree.js +++ b/buildTree.js @@ -285,6 +285,7 @@ var groupTypes = { var spacingClassMap = { "\\qquad": "qquad", "\\quad": "quad", + "\\enspace": "enspace", "\\;": "thickspace", "\\:": "mediumspace", "\\,": "thinspace", diff --git a/static/katex.less b/static/katex.less index fa2489c..2b462b6 100644 --- a/static/katex.less +++ b/static/katex.less @@ -248,6 +248,10 @@ big parens width: @thickspace; } + &.enspace { + width: 0.5em; + } + &.quad { width: 1em; }