AmsConfiguration.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = function (d, b) {
  4. extendStatics = Object.setPrototypeOf ||
  5. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  7. return extendStatics(d, b);
  8. };
  9. return function (d, b) {
  10. if (typeof b !== "function" && b !== null)
  11. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  12. extendStatics(d, b);
  13. function __() { this.constructor = d; }
  14. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15. };
  16. })();
  17. var _a;
  18. Object.defineProperty(exports, "__esModule", { value: true });
  19. exports.AmsConfiguration = exports.AmsTags = void 0;
  20. var Configuration_js_1 = require("../Configuration.js");
  21. var AmsItems_js_1 = require("./AmsItems.js");
  22. var Tags_js_1 = require("../Tags.js");
  23. var AmsMethods_js_1 = require("./AmsMethods.js");
  24. require("./AmsMappings.js");
  25. var SymbolMap_js_1 = require("../SymbolMap.js");
  26. var AmsTags = (function (_super) {
  27. __extends(AmsTags, _super);
  28. function AmsTags() {
  29. return _super !== null && _super.apply(this, arguments) || this;
  30. }
  31. return AmsTags;
  32. }(Tags_js_1.AbstractTags));
  33. exports.AmsTags = AmsTags;
  34. var init = function (config) {
  35. new SymbolMap_js_1.CommandMap(AmsMethods_js_1.NEW_OPS, {}, {});
  36. config.append(Configuration_js_1.Configuration.local({ handler: { macro: [AmsMethods_js_1.NEW_OPS] },
  37. priority: -1 }));
  38. };
  39. exports.AmsConfiguration = Configuration_js_1.Configuration.create('ams', {
  40. handler: {
  41. character: ['AMSmath-operatorLetter'],
  42. delimiter: ['AMSsymbols-delimiter', 'AMSmath-delimiter'],
  43. macro: ['AMSsymbols-mathchar0mi', 'AMSsymbols-mathchar0mo',
  44. 'AMSsymbols-delimiter', 'AMSsymbols-macros',
  45. 'AMSmath-mathchar0mo', 'AMSmath-macros', 'AMSmath-delimiter'],
  46. environment: ['AMSmath-environment']
  47. },
  48. items: (_a = {},
  49. _a[AmsItems_js_1.MultlineItem.prototype.kind] = AmsItems_js_1.MultlineItem,
  50. _a[AmsItems_js_1.FlalignItem.prototype.kind] = AmsItems_js_1.FlalignItem,
  51. _a),
  52. tags: { 'ams': AmsTags },
  53. init: init,
  54. config: function (_config, jax) {
  55. if (jax.parseOptions.options.multlineWidth) {
  56. jax.parseOptions.options.ams.multlineWidth = jax.parseOptions.options.multlineWidth;
  57. }
  58. delete jax.parseOptions.options.multlineWidth;
  59. },
  60. options: {
  61. multlineWidth: '',
  62. ams: {
  63. multlineWidth: '100%',
  64. multlineIndent: '1em',
  65. }
  66. }
  67. });
  68. //# sourceMappingURL=AmsConfiguration.js.map