mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-07 04:08:43 +00:00
extract overline, underline, and rule into their own files (#999)
This commit is contained in:
@@ -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";
|
||||
|
||||
|
Reference in New Issue
Block a user