Add llap and rlap

Summary:
By the powers of Greyskull (and maybe css) we have vanquished the
great and powerful llap! All hail!

Test Plan: Add some \llap and \rlap. Make sure it's positioned correctly.

Reviewers: spicyj

Reviewed By: spicyj

Differential Revision: http://phabricator.benalpert.com/D48
This commit is contained in:
Emily Eisenberg 2013-07-09 16:02:44 -07:00
parent b016015d4e
commit 66a43f551d
4 changed files with 25 additions and 1 deletions

View File

@ -80,6 +80,12 @@ var buildGroup = function(group, prev) {
return makeSpan("mord mspace " + spacingClassMap[group.value]);
}
} else if (group.type === "llap") {
var inner = makeSpan("", buildExpression(group.value));
return makeSpan("llap", inner);
} else if (group.type === "rlap") {
var inner = makeSpan("", buildExpression(group.value));
return makeSpan("rlap", inner);
} else {
console.log("Unknown type:", group.type);
}

View File

@ -25,7 +25,7 @@ var funcs = [
// Colors
'blue', 'orange', 'pink', 'red', 'green', 'gray', 'purple',
// Other functions
'dfrac'
'dfrac', 'llap', 'rlap'
];
var anyFunc = new RegExp("^\\\\(" + funcs.join("|") + ")(?![a-zA-Z])");

View File

@ -90,6 +90,10 @@ func
{$$ = [{type: 'color', value: {color: 'purple', value: $2}}];}
| 'dfrac' group group
{$$ = [{type: 'dfrac', value: {numer: $2, denom: $3}}];}
| 'llap' group
{$$ = [{type: 'llap', value: $2}];}
| 'rlap' group
{$$ = [{type: 'rlap', value: $2}];}
;
atom

View File

@ -129,6 +129,20 @@ big parens
width: 2em;
}
.llap, .rlap {
width: 0;
position: relative;
}
.llap > span {
position: absolute;
right: 0;
}
.rlap > span {
position: absolute;
left: 0;
}
.mord.blue { color: #6495ed; }
.mord.orange { color: #ffa500; }