@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-cli.js
CHANGED
|
@@ -409,7 +409,7 @@ var DelimiterNode = class extends BaseAstNode {
|
|
|
409
409
|
this.rightDelimExpr = rightDelimExpr2;
|
|
410
410
|
}
|
|
411
411
|
latex() {
|
|
412
|
-
return this.leftDelimExpr + this.innerExpr.latex() + this.rightDelimExpr + this.latexScripts();
|
|
412
|
+
return this.leftDelimExpr + " " + this.innerExpr.latex() + this.rightDelimExpr + this.latexScripts();
|
|
413
413
|
}
|
|
414
414
|
arabicLatex() {
|
|
415
415
|
const sup = this.superscript !== null ? this.superscript.arabicLatex() : "";
|
|
@@ -2956,6 +2956,21 @@ function renderDivideOperatorLatex(side) {
|
|
|
2956
2956
|
return side === "arabic" ? "\\backslash" : DIVIDE_OPERATOR_EN;
|
|
2957
2957
|
}
|
|
2958
2958
|
|
|
2959
|
+
// src/editor/rawOperatorPresentation.ts
|
|
2960
|
+
var RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE = {
|
|
2961
|
+
"<": ">",
|
|
2962
|
+
">": "<"
|
|
2963
|
+
};
|
|
2964
|
+
function renderRawOperatorLatex(expr, side) {
|
|
2965
|
+
if (isDivideOperatorExpr(expr)) {
|
|
2966
|
+
return renderDivideOperatorLatex(side);
|
|
2967
|
+
}
|
|
2968
|
+
if (side === "arabic" && Object.prototype.hasOwnProperty.call(RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE, expr)) {
|
|
2969
|
+
return `\\butexmirror{${expr}}`;
|
|
2970
|
+
}
|
|
2971
|
+
return expr;
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2959
2974
|
// src/editor/render.ts
|
|
2960
2975
|
function selectedDigitForm(options) {
|
|
2961
2976
|
return options?.digitForm ?? "western";
|
|
@@ -3063,7 +3078,7 @@ function renderCharContent(node, options) {
|
|
|
3063
3078
|
}
|
|
3064
3079
|
function renderNodeEnglish(node, options) {
|
|
3065
3080
|
if (node.kind === "delimiter" && node.innerExpr) {
|
|
3066
|
-
return `${node.leftDelimExpr}${renderChainEnglish(node.innerExpr, options)}${node.rightDelimExpr}${latinScripts(node, options)}`;
|
|
3081
|
+
return `${node.leftDelimExpr} ${renderChainEnglish(node.innerExpr, options)}${node.rightDelimExpr}${latinScripts(node, options)}`;
|
|
3067
3082
|
}
|
|
3068
3083
|
if (node.kind === "boxed" && node.innerExpr) {
|
|
3069
3084
|
const body = `\\boxed{${renderChainEnglish(node.innerExpr, options)}}`;
|
|
@@ -3115,8 +3130,8 @@ function renderNodeEnglish(node, options) {
|
|
|
3115
3130
|
}
|
|
3116
3131
|
return `${renderCharContent(node, options)}${latinScripts(node, options)}`;
|
|
3117
3132
|
}
|
|
3118
|
-
if (node.kind === "operator"
|
|
3119
|
-
return `${
|
|
3133
|
+
if (node.kind === "operator") {
|
|
3134
|
+
return `${renderRawOperatorLatex(node.expr, "english")}${latinScripts(node, options)}`;
|
|
3120
3135
|
}
|
|
3121
3136
|
return `${formatDigits(node.expr, selectedDigitForm(options))}${latinScripts(node, options)}`;
|
|
3122
3137
|
}
|
|
@@ -3176,8 +3191,8 @@ function renderNodeArabic(node, options) {
|
|
|
3176
3191
|
}
|
|
3177
3192
|
return arabicScripts(node, (node.characterFont ?? "default") === "default" ? `\\text{${escapeText(expr)}}` : content, options);
|
|
3178
3193
|
}
|
|
3179
|
-
if (node.kind === "operator"
|
|
3180
|
-
return arabicScripts(node,
|
|
3194
|
+
if (node.kind === "operator") {
|
|
3195
|
+
return arabicScripts(node, renderRawOperatorLatex(node.expr, "arabic"), options);
|
|
3181
3196
|
}
|
|
3182
3197
|
return arabicScripts(node, formatDigits(node.expr, selectedDigitForm(options)), options);
|
|
3183
3198
|
}
|