Merge pull request #293 from gagern/matrices

Matrices should be of type ord
This commit is contained in:
Kevin Barabash 2015-07-10 09:52:49 -06:00
commit 549c2bf858
4 changed files with 6 additions and 3 deletions

View File

@ -32,7 +32,8 @@ var buildExpression = function(expression, options, prev) {
return groups; return groups;
}; };
// List of types used by getTypeOfGroup // List of types used by getTypeOfGroup,
// see https://github.com/Khan/KaTeX/wiki/Examining-TeX#group-types
var groupToType = { var groupToType = {
mathord: "mord", mathord: "mord",
textord: "mord", textord: "mord",
@ -43,7 +44,7 @@ var groupToType = {
close: "mclose", close: "mclose",
inner: "minner", inner: "minner",
genfrac: "mord", genfrac: "mord",
array: "minner", array: "mord",
spacing: "mord", spacing: "mord",
punct: "mpunct", punct: "mpunct",
ordgroup: "mord", ordgroup: "mord",
@ -615,7 +616,7 @@ var groupTypes = {
} }
} }
body = makeSpan(["mtable"], cols); body = makeSpan(["mtable"], cols);
return makeSpan(["minner"], [body], options.getColor()); return makeSpan(["mord"], [body], options.getColor());
}, },
spacing: function(group, options, prev) { spacing: function(group, options, prev) {

View File

@ -7,6 +7,7 @@
normal font), or "ams" (the ams fonts). normal font), or "ams" (the ams fonts).
* - group (required): the ParseNode group type the symbol should have (i.e. * - group (required): the ParseNode group type the symbol should have (i.e.
"textord", "mathord", etc). "textord", "mathord", etc).
See https://github.com/Khan/KaTeX/wiki/Examining-TeX#group-types
* - replace (optional): the character that this symbol or function should be * - replace (optional): the character that this symbol or function should be
* replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi * replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi
* character in the main font). * character in the main font).

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -1,6 +1,7 @@
{ {
"Accents": "http://localhost:7936/test/screenshotter/test.html?m=\\vec{A}\\vec{x}\\vec x^2\\vec{x}_2^2\\vec{A}^2\\vec{xA}^2", "Accents": "http://localhost:7936/test/screenshotter/test.html?m=\\vec{A}\\vec{x}\\vec x^2\\vec{x}_2^2\\vec{A}^2\\vec{xA}^2",
"Arrays": "http://localhost:7936/test/screenshotter/test.html?m=\\left(\\begin{array}{rlc}1%262%263\\\\1+1%262+1%263+1\\cr1\\over2%26\\scriptstyle 1/2%26\\frac12\\\\[1ex]\\begin{pmatrix}x\\\\y\\end{pmatrix}%260%26\\begin{vmatrix}a%26b\\\\c%26d\\end{vmatrix}\\end{array}\\right]", "Arrays": "http://localhost:7936/test/screenshotter/test.html?m=\\left(\\begin{array}{rlc}1%262%263\\\\1+1%262+1%263+1\\cr1\\over2%26\\scriptstyle 1/2%26\\frac12\\\\[1ex]\\begin{pmatrix}x\\\\y\\end{pmatrix}%260%26\\begin{vmatrix}a%26b\\\\c%26d\\end{vmatrix}\\end{array}\\right]",
"ArrayType": "http://localhost:7936/test/screenshotter/test.html?m=1\\begin{array}{c}2\\\\3\\end{array}4",
"Baseline": "http://localhost:7936/test/screenshotter/test.html?m=a+b-c\\cdot d/e", "Baseline": "http://localhost:7936/test/screenshotter/test.html?m=a+b-c\\cdot d/e",
"BasicTest": "http://localhost:7936/test/screenshotter/test.html?m=a", "BasicTest": "http://localhost:7936/test/screenshotter/test.html?m=a",
"BinomTest": "http://localhost:7936/test/screenshotter/test.html?m=\\dbinom{a}{b}\\tbinom{a}{b}^{\\binom{a}{b}+17}", "BinomTest": "http://localhost:7936/test/screenshotter/test.html?m=\\dbinom{a}{b}\\tbinom{a}{b}^{\\binom{a}{b}+17}",