mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-12 14:38:39 +00:00
Add \pm, \div
Reviewers: xymostech Reviewed By: xymostech Differential Revision: http://phabricator.benalpert.com/D36
This commit is contained in:
12
MJLite.js
12
MJLite.js
@@ -62,11 +62,13 @@ var MJLite = (function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var charLookup = {
|
var charLookup = {
|
||||||
'*': '\u2217',
|
"*": "\u2217",
|
||||||
'-': '\u2212',
|
"-": "\u2212",
|
||||||
'cdot': '\u22C5',
|
"cdot": "\u22C5",
|
||||||
'lvert': '|',
|
"lvert": "|",
|
||||||
'rvert': '|'
|
"rvert": "|",
|
||||||
|
"pm": "\u00b1",
|
||||||
|
"div": "\u00f7"
|
||||||
};
|
};
|
||||||
|
|
||||||
var textit = function(value) {
|
var textit = function(value) {
|
||||||
|
@@ -9,6 +9,8 @@ cdot return 'CDOT'
|
|||||||
frac return 'FRAC'
|
frac return 'FRAC'
|
||||||
lvert return 'LVERT'
|
lvert return 'LVERT'
|
||||||
rvert return 'RVERT'
|
rvert return 'RVERT'
|
||||||
|
pm return 'PM'
|
||||||
|
div return 'DIV'
|
||||||
[/|a-zA-Z0-9] return 'ORD'
|
[/|a-zA-Z0-9] return 'ORD'
|
||||||
[*+-] return 'BIN'
|
[*+-] return 'BIN'
|
||||||
\^ return '^'
|
\^ return '^'
|
||||||
@@ -66,6 +68,10 @@ group
|
|||||||
func
|
func
|
||||||
: 'CDOT'
|
: 'CDOT'
|
||||||
{$$ = [{type: 'bin', value: yytext}];}
|
{$$ = [{type: 'bin', value: yytext}];}
|
||||||
|
| 'PM'
|
||||||
|
{$$ = [{type: 'bin', value: yytext}];}
|
||||||
|
| 'DIV'
|
||||||
|
{$$ = [{type: 'bin', value: yytext}];}
|
||||||
| 'FRAC' group group
|
| 'FRAC' group group
|
||||||
{$$ = [{type: 'frac', value: {numer: $2, denom: $3}}];}
|
{$$ = [{type: 'frac', value: {numer: $2, denom: $3}}];}
|
||||||
| 'LVERT'
|
| 'LVERT'
|
||||||
|
Reference in New Issue
Block a user