extract overline, underline, and rule into their own files (#999)

This commit is contained in:
Kevin Barabash
2017-11-27 23:42:55 -05:00
committed by GitHub
parent 7036eb85cd
commit 98203ad6ba
9 changed files with 195 additions and 158 deletions

View File

@@ -124,44 +124,11 @@ defineFunction(["\\fcolorbox"], {
};
});
// An overline
defineFunction(["\\overline"], {
numArgs: 1,
}, function(context, args) {
const body = args[0];
return {
type: "overline",
body: body,
};
});
import "./functions/overline";
// An underline
defineFunction(["\\underline"], {
numArgs: 1,
}, function(context, args) {
const body = args[0];
return {
type: "underline",
body: body,
};
});
import "./functions/underline";
// A box of the width and height
defineFunction(["\\rule"], {
numArgs: 2,
numOptionalArgs: 1,
argTypes: ["size", "size", "size"],
}, function(context, args, optArgs) {
const shift = optArgs[0];
const width = args[0];
const height = args[1];
return {
type: "rule",
shift: shift && shift.value,
width: width.value,
height: height.value,
};
});
import "./functions/rule";
import "./functions/kern";