@drghaliasri/butex 7.2.2 → 7.3.1

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.
@@ -183,6 +183,12 @@ mjx-container[jax="CHTML"] .butex-preview-mirror {
183
183
  unicode-bidi: isolate;
184
184
  }
185
185
 
186
+ .butex-unit-text,
187
+ .butex-unit-text mjx-utext {
188
+ font-style: normal !important;
189
+ font-weight: 400;
190
+ }
191
+
186
192
  .butex-diwani-command {
187
193
  font-family: ${BUTEX_DIWANI_FONT_STACK};
188
194
  direction: rtl;
@@ -899,6 +905,16 @@ mjx-container[jax="CHTML"] .butex-preview-mirror {
899
905
  const inner = new TexParserClass(arg, parser.stack.env, parser.configuration).mml();
900
906
  parser.Push(inner);
901
907
  }
908
+ function unitArgument(parser, name) {
909
+ const text = parser.GetArgument(name);
910
+ const node = parser.create(
911
+ "token",
912
+ "mtext",
913
+ { class: "butex-unit-text", "data-butex-unit": text },
914
+ text
915
+ );
916
+ parser.Push(node);
917
+ }
902
918
  function arabvecArgument(parser, name) {
903
919
  const arg = parser.GetArgument(name);
904
920
  const TexParserClass = parser.constructor;
@@ -907,10 +923,11 @@ mjx-container[jax="CHTML"] .butex-preview-mirror {
907
923
  parser.Push(inner);
908
924
  }
909
925
  var passthroughArgumentTyped = passthroughArgument;
926
+ var unitArgumentTyped = unitArgument;
910
927
  var arabvecArgumentTyped = arabvecArgument;
911
928
  function registerPassthroughCommandMacros(CommandMap) {
912
929
  new CommandMap(COMMAND_MAP7, {
913
- unit: passthroughArgumentTyped,
930
+ unit: unitArgumentTyped,
914
931
  idx: passthroughArgumentTyped,
915
932
  arabvec: arabvecArgumentTyped
916
933
  });
@@ -2970,6 +2987,13 @@ ${CHARACTER_FONT_CSS}
2970
2987
  font-weight: 700;
2971
2988
  }
2972
2989
 
2990
+ .node-value--unit {
2991
+ font-style: normal;
2992
+ text-decoration-line: underline;
2993
+ text-decoration-style: dotted;
2994
+ text-underline-offset: 0.2em;
2995
+ }
2996
+
2973
2997
  .chain {
2974
2998
  display: inline-flex;
2975
2999
  align-items: center;
@@ -3505,8 +3529,9 @@ ${STANDARD_COMMAND_CSS}
3505
3529
  // src/editor/divideOperator.ts
3506
3530
  var DIVIDE_OPERATOR_EN = "/";
3507
3531
  var DIVIDE_OPERATOR_AR = "\\";
3532
+ var DIVIDE_OPERATOR_AR_LATEX = "\\backslash";
3508
3533
  function isDivideOperatorExpr(expr) {
3509
- return expr === DIVIDE_OPERATOR_EN || expr === DIVIDE_OPERATOR_AR;
3534
+ return expr === DIVIDE_OPERATOR_EN || expr === DIVIDE_OPERATOR_AR || expr === DIVIDE_OPERATOR_AR_LATEX;
3510
3535
  }
3511
3536
  function divideOperatorSurfaceExpr(expr, side) {
3512
3537
  if (!isDivideOperatorExpr(expr)) {
@@ -6093,6 +6118,10 @@ ${STANDARD_COMMAND_CSS}
6093
6118
  if (node.wrapperCommand === "\\boldarabic" || node.wrapperCommand === "\\mathbf") {
6094
6119
  value.classList.add("node-value--bold");
6095
6120
  }
6121
+ if (node.wrapperCommand === "\\unit") {
6122
+ value.classList.add("node-value--unit");
6123
+ value.title = "\u0648\u062D\u062F\u0629 (unit)";
6124
+ }
6096
6125
  }
6097
6126
  const surfaceExpr = node.kind === "operator" ? divideOperatorSurfaceExpr(node.expr, side) : node.expr;
6098
6127
  value.textContent = surfaceExpr === "" ? "\u25A1" : formatDigits(surfaceExpr, digitForm);