CancelConfiguration.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. exports.CancelConfiguration = exports.CancelMethods = void 0;
  7. var Configuration_js_1 = require("../Configuration.js");
  8. var TexConstants_js_1 = require("../TexConstants.js");
  9. var SymbolMap_js_1 = require("../SymbolMap.js");
  10. var ParseUtil_js_1 = __importDefault(require("../ParseUtil.js"));
  11. var EncloseConfiguration_js_1 = require("../enclose/EncloseConfiguration.js");
  12. exports.CancelMethods = {};
  13. exports.CancelMethods.Cancel = function (parser, name, notation) {
  14. var attr = parser.GetBrackets(name, '');
  15. var math = parser.ParseArg(name);
  16. var def = ParseUtil_js_1.default.keyvalOptions(attr, EncloseConfiguration_js_1.ENCLOSE_OPTIONS);
  17. def['notation'] = notation;
  18. parser.Push(parser.create('node', 'menclose', [math], def));
  19. };
  20. exports.CancelMethods.CancelTo = function (parser, name) {
  21. var attr = parser.GetBrackets(name, '');
  22. var value = parser.ParseArg(name);
  23. var math = parser.ParseArg(name);
  24. var def = ParseUtil_js_1.default.keyvalOptions(attr, EncloseConfiguration_js_1.ENCLOSE_OPTIONS);
  25. def['notation'] = [TexConstants_js_1.TexConstant.Notation.UPDIAGONALSTRIKE,
  26. TexConstants_js_1.TexConstant.Notation.UPDIAGONALARROW,
  27. TexConstants_js_1.TexConstant.Notation.NORTHEASTARROW].join(' ');
  28. value = parser.create('node', 'mpadded', [value], { depth: '-.1em', height: '+.1em', voffset: '.1em' });
  29. parser.Push(parser.create('node', 'msup', [parser.create('node', 'menclose', [math], def), value]));
  30. };
  31. new SymbolMap_js_1.CommandMap('cancel', {
  32. cancel: ['Cancel', TexConstants_js_1.TexConstant.Notation.UPDIAGONALSTRIKE],
  33. bcancel: ['Cancel', TexConstants_js_1.TexConstant.Notation.DOWNDIAGONALSTRIKE],
  34. xcancel: ['Cancel', TexConstants_js_1.TexConstant.Notation.UPDIAGONALSTRIKE + ' ' +
  35. TexConstants_js_1.TexConstant.Notation.DOWNDIAGONALSTRIKE],
  36. cancelto: 'CancelTo'
  37. }, exports.CancelMethods);
  38. exports.CancelConfiguration = Configuration_js_1.Configuration.create('cancel', { handler: { macro: ['cancel'] } });
  39. //# sourceMappingURL=CancelConfiguration.js.map