@drghaliasri/butex 8.0.0 → 8.0.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.
@@ -2132,6 +2132,15 @@ var ATOMIC_COMMANDS = {
2132
2132
  title: "\u0641\u0631\u0627\u063A \u0633\u0627\u0644\u0628 \u0631\u0641\u064A\u0639",
2133
2133
  spacing: { direction: "negative", level: 1 }
2134
2134
  },
2135
+ thinSpace: {
2136
+ id: "thinSpace",
2137
+ category: "spacing",
2138
+ englishTex: "\\,",
2139
+ arabicTex: "\\,",
2140
+ arabicLabel: "",
2141
+ title: "\u0641\u0631\u0627\u063A \u0631\u0641\u064A\u0639",
2142
+ spacing: { direction: "positive", level: 1 }
2143
+ },
2135
2144
  mediumSpace: {
2136
2145
  id: "mediumSpace",
2137
2146
  category: "spacing",
@@ -3356,6 +3365,10 @@ function renderNodeEnglish(node, options) {
3356
3365
  }
3357
3366
  if (node.kind === "char") {
3358
3367
  if (node.sourceLatex) {
3368
+ if (node.wrapperCommand === "\\boldarabic" || node.wrapperCommand === "\\mathbf") {
3369
+ const boldSource = node.sourceLatex.startsWith("\\mathbf{") ? node.sourceLatex : `\\mathbf{${node.sourceLatex}}`;
3370
+ return `${boldSource}${latinScripts(node, options)}`;
3371
+ }
3359
3372
  return `${node.sourceLatex}${latinScripts(node, options)}`;
3360
3373
  }
3361
3374
  if (node.wrapperCommand) {
@@ -4297,6 +4310,7 @@ var ENGLISH_COMMAND_TITLES = {
4297
4310
  C: "Complex numbers",
4298
4311
  H: "Quaternions",
4299
4312
  negThinSpace: "Negative thin space",
4313
+ thinSpace: "Thin space",
4300
4314
  mediumSpace: "Medium space",
4301
4315
  thickSpace: "Thick space",
4302
4316
  quadSpace: "Large space",
@@ -8467,20 +8481,27 @@ function editableWrapperCommand(node) {
8467
8481
  return null;
8468
8482
  }
8469
8483
  const child = singleCommandChar(node);
8470
- if (!child) {
8471
- return null;
8472
- }
8473
- const normalized = normalizeCharImportExpr(child.expr);
8474
- const editorNode = createEditorNode("char", normalized.expr);
8475
- if (normalized.characterFont !== "default") {
8476
- editorNode.characterFont = normalized.characterFont;
8484
+ let editorNode;
8485
+ if (child) {
8486
+ const normalized = normalizeCharImportExpr(child.expr);
8487
+ editorNode = createEditorNode("char", normalized.expr);
8488
+ if (normalized.characterFont !== "default") {
8489
+ editorNode.characterFont = normalized.characterFont;
8490
+ }
8491
+ } else {
8492
+ if (node.optionalArgs.length || node.mandatoryArgs.length !== 1) return null;
8493
+ const nodes = node.mandatoryArgs[0]?.chain;
8494
+ if (!nodes || nodes.length !== 1 || !(nodes[0] instanceof CommandNode)) return null;
8495
+ const nested = charFromTextLikeCommand(nodes[0]);
8496
+ if (!nested?.editable) return null;
8497
+ editorNode = nested.node;
8477
8498
  }
8478
8499
  editorNode.wrapperCommand = node.name === "\\mathtt" ? "\\mathtt" : node.name === "\\mathbf" ? "\\mathbf" : node.name === "\\boldarabic" ? "\\boldarabic" : "\\unit";
8479
8500
  const scripts = attachScripts(node, editorNode);
8480
8501
  if (scripts) {
8481
8502
  return scripts;
8482
8503
  }
8483
- if (!editorNode.sourceLatex && node.name === "\\mathsf") {
8504
+ if (!editorNode.sourceLatex && node.name === "\\mathsf" && child) {
8484
8505
  editorNode.sourceLatex = `\\mathsf{${child.expr}}`;
8485
8506
  }
8486
8507
  return { editable: true, node: editorNode };