| Server IP : 121.121.20.254 / Your IP : 216.73.216.252 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Program Files/Microsoft VS Code/ce099c1ed2/resources/app/node_modules/katex/src/functions/ |
Upload File : |
// @flow
import defineFunction, {ordargument} from "../defineFunction";
import buildCommon from "../buildCommon";
import mathMLTree from "../mathMLTree";
import * as html from "../buildHTML";
import * as mml from "../buildMathML";
// \hbox is provided for compatibility with LaTeX \vcenter.
// In LaTeX, \vcenter can act only on a box, as in
// \vcenter{\hbox{$\frac{a+b}{\dfrac{c}{d}}$}}
// This function by itself doesn't do anything but prevent a soft line break.
defineFunction({
type: "hbox",
names: ["\\hbox"],
props: {
numArgs: 1,
argTypes: ["text"],
allowedInText: true,
primitive: true,
},
handler({parser}, args) {
return {
type: "hbox",
mode: parser.mode,
body: ordargument(args[0]),
};
},
htmlBuilder(group, options) {
const elements = html.buildExpression(group.body, options, false);
return buildCommon.makeFragment(elements);
},
mathmlBuilder(group, options) {
return new mathMLTree.MathNode(
"mrow", mml.buildExpression(group.body, options)
);
},
});