MCPcopy Create free account
hub / github.com/TruthHun/BookStack / binrelClass

Function binrelClass

static/katex/katex.js:10093–10105  ·  view source on GitHub ↗
(arg)

Source from the content-addressed store, hash-verified

10091 mathmlBuilder: mclass_mathmlBuilder
10092});
10093var binrelClass = function binrelClass(arg) {
10094 // \binrel@ spacing varies with (bin|rel|ord) of the atom in the argument.
10095 // (by rendering separately and with {}s before and after, and measuring
10096 // the change in spacing). We'll do roughly the same by detecting the
10097 // atom type directly.
10098 var atom = arg.type === "ordgroup" && arg.body.length ? arg.body[0] : arg;
10099
10100 if (atom.type === "atom" && (atom.family === "bin" || atom.family === "rel")) {
10101 return "m" + atom.family;
10102 } else {
10103 return "mord";
10104 }
10105}; // \@binrel{x}{y} renders like y but as mbin/mrel/mord if x is mbin/mrel/mord.
10106// This is equivalent to \binrel@{x}\binrel@@{y} in AMSTeX.
10107
10108defineFunction({

Callers 1

katex.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected