@drghaliasri/butex 7.3.2 → 7.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/document.js +18 -3
- package/dist/document.js.map +1 -1
- package/dist/document.mjs +18 -3
- package/dist/document.mjs.map +1 -1
- package/dist/document2-cli.js +21 -6
- package/dist/document2-cli.js.map +1 -1
- package/dist/document2.js +21 -6
- package/dist/document2.js.map +1 -1
- package/dist/document2.mjs +21 -6
- package/dist/document2.mjs.map +1 -1
- package/dist/index.global.js +30 -6
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +30 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -6
- package/dist/index.mjs.map +1 -1
- package/dist/react-document.js +31 -7
- package/dist/react-document.js.map +1 -1
- package/dist/react-document.mjs +31 -7
- package/dist/react-document.mjs.map +1 -1
- package/dist/react-document2-preview.js +21 -6
- package/dist/react-document2-preview.js.map +1 -1
- package/dist/react-document2-preview.mjs +21 -6
- package/dist/react-document2-preview.mjs.map +1 -1
- package/dist/react-document2.js +31 -7
- package/dist/react-document2.js.map +1 -1
- package/dist/react-document2.mjs +31 -7
- package/dist/react-document2.mjs.map +1 -1
- package/dist/react.js +31 -7
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +31 -7
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/document2.mjs
CHANGED
|
@@ -506,7 +506,7 @@ var DelimiterNode = class extends BaseAstNode {
|
|
|
506
506
|
this.rightDelimExpr = rightDelimExpr2;
|
|
507
507
|
}
|
|
508
508
|
latex() {
|
|
509
|
-
return this.leftDelimExpr + this.innerExpr.latex() + this.rightDelimExpr + this.latexScripts();
|
|
509
|
+
return this.leftDelimExpr + " " + this.innerExpr.latex() + this.rightDelimExpr + this.latexScripts();
|
|
510
510
|
}
|
|
511
511
|
arabicLatex() {
|
|
512
512
|
const sup = this.superscript !== null ? this.superscript.arabicLatex() : "";
|
|
@@ -3112,6 +3112,21 @@ function renderDivideOperatorLatex(side) {
|
|
|
3112
3112
|
return side === "arabic" ? "\\backslash" : DIVIDE_OPERATOR_EN;
|
|
3113
3113
|
}
|
|
3114
3114
|
|
|
3115
|
+
// src/editor/rawOperatorPresentation.ts
|
|
3116
|
+
var RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE = {
|
|
3117
|
+
"<": ">",
|
|
3118
|
+
">": "<"
|
|
3119
|
+
};
|
|
3120
|
+
function renderRawOperatorLatex(expr, side) {
|
|
3121
|
+
if (isDivideOperatorExpr(expr)) {
|
|
3122
|
+
return renderDivideOperatorLatex(side);
|
|
3123
|
+
}
|
|
3124
|
+
if (side === "arabic" && Object.prototype.hasOwnProperty.call(RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE, expr)) {
|
|
3125
|
+
return `\\butexmirror{${expr}}`;
|
|
3126
|
+
}
|
|
3127
|
+
return expr;
|
|
3128
|
+
}
|
|
3129
|
+
|
|
3115
3130
|
// src/editor/render.ts
|
|
3116
3131
|
function selectedDigitForm(options) {
|
|
3117
3132
|
return options?.digitForm ?? "western";
|
|
@@ -3219,7 +3234,7 @@ function renderCharContent(node, options) {
|
|
|
3219
3234
|
}
|
|
3220
3235
|
function renderNodeEnglish(node, options) {
|
|
3221
3236
|
if (node.kind === "delimiter" && node.innerExpr) {
|
|
3222
|
-
return `${node.leftDelimExpr}${renderChainEnglish(node.innerExpr, options)}${node.rightDelimExpr}${latinScripts(node, options)}`;
|
|
3237
|
+
return `${node.leftDelimExpr} ${renderChainEnglish(node.innerExpr, options)}${node.rightDelimExpr}${latinScripts(node, options)}`;
|
|
3223
3238
|
}
|
|
3224
3239
|
if (node.kind === "boxed" && node.innerExpr) {
|
|
3225
3240
|
const body = `\\boxed{${renderChainEnglish(node.innerExpr, options)}}`;
|
|
@@ -3271,8 +3286,8 @@ function renderNodeEnglish(node, options) {
|
|
|
3271
3286
|
}
|
|
3272
3287
|
return `${renderCharContent(node, options)}${latinScripts(node, options)}`;
|
|
3273
3288
|
}
|
|
3274
|
-
if (node.kind === "operator"
|
|
3275
|
-
return `${
|
|
3289
|
+
if (node.kind === "operator") {
|
|
3290
|
+
return `${renderRawOperatorLatex(node.expr, "english")}${latinScripts(node, options)}`;
|
|
3276
3291
|
}
|
|
3277
3292
|
return `${formatDigits(node.expr, selectedDigitForm(options))}${latinScripts(node, options)}`;
|
|
3278
3293
|
}
|
|
@@ -3332,8 +3347,8 @@ function renderNodeArabic(node, options) {
|
|
|
3332
3347
|
}
|
|
3333
3348
|
return arabicScripts(node, (node.characterFont ?? "default") === "default" ? `\\text{${escapeText(expr)}}` : content, options);
|
|
3334
3349
|
}
|
|
3335
|
-
if (node.kind === "operator"
|
|
3336
|
-
return arabicScripts(node,
|
|
3350
|
+
if (node.kind === "operator") {
|
|
3351
|
+
return arabicScripts(node, renderRawOperatorLatex(node.expr, "arabic"), options);
|
|
3337
3352
|
}
|
|
3338
3353
|
return arabicScripts(node, formatDigits(node.expr, selectedDigitForm(options)), options);
|
|
3339
3354
|
}
|