@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
|
@@ -166,7 +166,7 @@ var DelimiterNode = class extends BaseAstNode {
|
|
|
166
166
|
this.rightDelimExpr = rightDelimExpr2;
|
|
167
167
|
}
|
|
168
168
|
latex() {
|
|
169
|
-
return this.leftDelimExpr + this.innerExpr.latex() + this.rightDelimExpr + this.latexScripts();
|
|
169
|
+
return this.leftDelimExpr + " " + this.innerExpr.latex() + this.rightDelimExpr + this.latexScripts();
|
|
170
170
|
}
|
|
171
171
|
arabicLatex() {
|
|
172
172
|
const sup = this.superscript !== null ? this.superscript.arabicLatex() : "";
|
|
@@ -2882,6 +2882,21 @@ function renderDivideOperatorLatex(side) {
|
|
|
2882
2882
|
return side === "arabic" ? "\\backslash" : DIVIDE_OPERATOR_EN;
|
|
2883
2883
|
}
|
|
2884
2884
|
|
|
2885
|
+
// src/editor/rawOperatorPresentation.ts
|
|
2886
|
+
var RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE = {
|
|
2887
|
+
"<": ">",
|
|
2888
|
+
">": "<"
|
|
2889
|
+
};
|
|
2890
|
+
function renderRawOperatorLatex(expr, side) {
|
|
2891
|
+
if (isDivideOperatorExpr(expr)) {
|
|
2892
|
+
return renderDivideOperatorLatex(side);
|
|
2893
|
+
}
|
|
2894
|
+
if (side === "arabic" && Object.prototype.hasOwnProperty.call(RTL_DIRECTIONAL_RAW_OPERATOR_SURFACE, expr)) {
|
|
2895
|
+
return `\\butexmirror{${expr}}`;
|
|
2896
|
+
}
|
|
2897
|
+
return expr;
|
|
2898
|
+
}
|
|
2899
|
+
|
|
2885
2900
|
// src/editor/render.ts
|
|
2886
2901
|
function selectedDigitForm(options) {
|
|
2887
2902
|
return options?.digitForm ?? "western";
|
|
@@ -2989,7 +3004,7 @@ function renderCharContent(node, options) {
|
|
|
2989
3004
|
}
|
|
2990
3005
|
function renderNodeEnglish(node, options) {
|
|
2991
3006
|
if (node.kind === "delimiter" && node.innerExpr) {
|
|
2992
|
-
return `${node.leftDelimExpr}${renderChainEnglish(node.innerExpr, options)}${node.rightDelimExpr}${latinScripts(node, options)}`;
|
|
3007
|
+
return `${node.leftDelimExpr} ${renderChainEnglish(node.innerExpr, options)}${node.rightDelimExpr}${latinScripts(node, options)}`;
|
|
2993
3008
|
}
|
|
2994
3009
|
if (node.kind === "boxed" && node.innerExpr) {
|
|
2995
3010
|
const body = `\\boxed{${renderChainEnglish(node.innerExpr, options)}}`;
|
|
@@ -3041,8 +3056,8 @@ function renderNodeEnglish(node, options) {
|
|
|
3041
3056
|
}
|
|
3042
3057
|
return `${renderCharContent(node, options)}${latinScripts(node, options)}`;
|
|
3043
3058
|
}
|
|
3044
|
-
if (node.kind === "operator"
|
|
3045
|
-
return `${
|
|
3059
|
+
if (node.kind === "operator") {
|
|
3060
|
+
return `${renderRawOperatorLatex(node.expr, "english")}${latinScripts(node, options)}`;
|
|
3046
3061
|
}
|
|
3047
3062
|
return `${formatDigits(node.expr, selectedDigitForm(options))}${latinScripts(node, options)}`;
|
|
3048
3063
|
}
|
|
@@ -3102,8 +3117,8 @@ function renderNodeArabic(node, options) {
|
|
|
3102
3117
|
}
|
|
3103
3118
|
return arabicScripts(node, (node.characterFont ?? "default") === "default" ? `\\text{${escapeText(expr)}}` : content, options);
|
|
3104
3119
|
}
|
|
3105
|
-
if (node.kind === "operator"
|
|
3106
|
-
return arabicScripts(node,
|
|
3120
|
+
if (node.kind === "operator") {
|
|
3121
|
+
return arabicScripts(node, renderRawOperatorLatex(node.expr, "arabic"), options);
|
|
3107
3122
|
}
|
|
3108
3123
|
return arabicScripts(node, formatDigits(node.expr, selectedDigitForm(options)), options);
|
|
3109
3124
|
}
|