1
0

add initial marp implementation with sample content and build configuration

This commit is contained in:
2025-09-13 18:13:22 +02:00
parent dcacc9b409
commit e5f219507f
10319 changed files with 1402023 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import { Configuration } from '../Configuration.js';
import TexParser from '../TexParser.js';
import { BeginItem } from '../base/BaseItems.js';
import { StackItem } from '../StackItem.js';
export declare class EmpheqBeginItem extends BeginItem {
get kind(): string;
checkItem(item: StackItem): import("../StackItem.js").CheckType;
}
export declare const EmpheqMethods: {
Empheq(parser: TexParser, begin: EmpheqBeginItem): void;
EmpheqMO(parser: TexParser, _name: string, c: string): void;
EmpheqDelim(parser: TexParser, name: string): void;
};
export declare const EmpheqConfiguration: Configuration;

View File

@@ -0,0 +1,151 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmpheqConfiguration = exports.EmpheqMethods = exports.EmpheqBeginItem = void 0;
var Configuration_js_1 = require("../Configuration.js");
var SymbolMap_js_1 = require("../SymbolMap.js");
var ParseUtil_js_1 = __importDefault(require("../ParseUtil.js"));
var TexError_js_1 = __importDefault(require("../TexError.js"));
var BaseItems_js_1 = require("../base/BaseItems.js");
var EmpheqUtil_js_1 = require("./EmpheqUtil.js");
var EmpheqBeginItem = (function (_super) {
__extends(EmpheqBeginItem, _super);
function EmpheqBeginItem() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(EmpheqBeginItem.prototype, "kind", {
get: function () {
return 'empheq-begin';
},
enumerable: false,
configurable: true
});
EmpheqBeginItem.prototype.checkItem = function (item) {
if (item.isKind('end') && item.getName() === this.getName()) {
this.setProperty('end', false);
}
return _super.prototype.checkItem.call(this, item);
};
return EmpheqBeginItem;
}(BaseItems_js_1.BeginItem));
exports.EmpheqBeginItem = EmpheqBeginItem;
exports.EmpheqMethods = {
Empheq: function (parser, begin) {
if (parser.stack.env.closing === begin.getName()) {
delete parser.stack.env.closing;
parser.Push(parser.itemFactory.create('end').setProperty('name', parser.stack.global.empheq));
parser.stack.global.empheq = '';
var empheq = parser.stack.Top();
EmpheqUtil_js_1.EmpheqUtil.adjustTable(empheq, parser);
parser.Push(parser.itemFactory.create('end').setProperty('name', 'empheq'));
}
else {
ParseUtil_js_1.default.checkEqnEnv(parser);
delete parser.stack.global.eqnenv;
var opts = parser.GetBrackets('\\begin{' + begin.getName() + '}') || '';
var _a = __read((parser.GetArgument('\\begin{' + begin.getName() + '}') || '').split(/=/), 2), env = _a[0], n = _a[1];
if (!EmpheqUtil_js_1.EmpheqUtil.checkEnv(env)) {
throw new TexError_js_1.default('UnknownEnv', 'Unknown environment "%1"', env);
}
if (opts) {
begin.setProperties(EmpheqUtil_js_1.EmpheqUtil.splitOptions(opts, { left: 1, right: 1 }));
}
parser.stack.global.empheq = env;
parser.string = '\\begin{' + env + '}' + (n ? '{' + n + '}' : '') + parser.string.slice(parser.i);
parser.i = 0;
parser.Push(begin);
}
},
EmpheqMO: function (parser, _name, c) {
parser.Push(parser.create('token', 'mo', {}, c));
},
EmpheqDelim: function (parser, name) {
var c = parser.GetDelimiter(name);
parser.Push(parser.create('token', 'mo', { stretchy: true, symmetric: true }, c));
}
};
new SymbolMap_js_1.EnvironmentMap('empheq-env', EmpheqUtil_js_1.EmpheqUtil.environment, {
empheq: ['Empheq', 'empheq'],
}, exports.EmpheqMethods);
new SymbolMap_js_1.CommandMap('empheq-macros', {
empheqlbrace: ['EmpheqMO', '{'],
empheqrbrace: ['EmpheqMO', '}'],
empheqlbrack: ['EmpheqMO', '['],
empheqrbrack: ['EmpheqMO', ']'],
empheqlangle: ['EmpheqMO', '\u27E8'],
empheqrangle: ['EmpheqMO', '\u27E9'],
empheqlparen: ['EmpheqMO', '('],
empheqrparen: ['EmpheqMO', ')'],
empheqlvert: ['EmpheqMO', '|'],
empheqrvert: ['EmpheqMO', '|'],
empheqlVert: ['EmpheqMO', '\u2016'],
empheqrVert: ['EmpheqMO', '\u2016'],
empheqlfloor: ['EmpheqMO', '\u230A'],
empheqrfloor: ['EmpheqMO', '\u230B'],
empheqlceil: ['EmpheqMO', '\u2308'],
empheqrceil: ['EmpheqMO', '\u2309'],
empheqbiglbrace: ['EmpheqMO', '{'],
empheqbigrbrace: ['EmpheqMO', '}'],
empheqbiglbrack: ['EmpheqMO', '['],
empheqbigrbrack: ['EmpheqMO', ']'],
empheqbiglangle: ['EmpheqMO', '\u27E8'],
empheqbigrangle: ['EmpheqMO', '\u27E9'],
empheqbiglparen: ['EmpheqMO', '('],
empheqbigrparen: ['EmpheqMO', ')'],
empheqbiglvert: ['EmpheqMO', '|'],
empheqbigrvert: ['EmpheqMO', '|'],
empheqbiglVert: ['EmpheqMO', '\u2016'],
empheqbigrVert: ['EmpheqMO', '\u2016'],
empheqbiglfloor: ['EmpheqMO', '\u230A'],
empheqbigrfloor: ['EmpheqMO', '\u230B'],
empheqbiglceil: ['EmpheqMO', '\u2308'],
empheqbigrceil: ['EmpheqMO', '\u2309'],
empheql: 'EmpheqDelim',
empheqr: 'EmpheqDelim',
empheqbigl: 'EmpheqDelim',
empheqbigr: 'EmpheqDelim'
}, exports.EmpheqMethods);
exports.EmpheqConfiguration = Configuration_js_1.Configuration.create('empheq', {
handler: {
macro: ['empheq-macros'],
environment: ['empheq-env'],
},
items: (_a = {},
_a[EmpheqBeginItem.prototype.kind] = EmpheqBeginItem,
_a)
});
//# sourceMappingURL=EmpheqConfiguration.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"EmpheqConfiguration.js","sourceRoot":"","sources":["../../../../ts/input/tex/empheq/EmpheqConfiguration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,wDAAkD;AAClD,gDAA2D;AAC3D,iEAAwC;AAExC,+DAAsC;AACtC,qDAA+C;AAE/C,iDAA2C;AAK3C;IAAqC,mCAAS;IAA9C;;IAmBA,CAAC;IAdC,sBAAW,iCAAI;aAAf;YACE,OAAO,cAAc,CAAC;QACxB,CAAC;;;OAAA;IAKM,mCAAS,GAAhB,UAAiB,IAAe;QAC9B,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,OAAO,EAAE,EAAE;YAC3D,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;SAChC;QACD,OAAO,iBAAM,SAAS,YAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAEH,sBAAC;AAAD,CAAC,AAnBD,CAAqC,wBAAS,GAmB7C;AAnBY,0CAAe;AAwBf,QAAA,aAAa,GAAG;IAQ3B,MAAM,EAAN,UAAO,MAAiB,EAAE,KAAsB;QAC9C,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,EAAE;YAChD,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;YAChC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,WAA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ACvC,eAAe,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;IACvC,cAAc,EAAG,CAAC,UAAU,EAAE,QAAQ,CAAC;IACvC,cAAc,EAAG,CAAC,UAAU,EAAE,QAAQ,CAAC;IACvC,OAAO,EAAW,aAAa;IAC/B,OAAO,EAAW,aAAa;IAC/B,UAAU,EAAQ,aAAa;IAC/B,UAAU,EAAQ,aAAa;CAChC,EAAE,qBAAa,CAAC,CAAC;AAKL,QAAA,mBAAmB,GAAG,gCAAa,CAAC,MAAM,CAAC,QAAQ,EAAE;IAChE,OAAO,EAAE;QACP,KAAK,EAAE,CAAC,eAAe,CAAC;QACxB,WAAW,EAAE,CAAC,YAAY,CAAC;KAC5B;IACD,KAAK;QACH,GAAC,eAAe,CAAC,SAAS,CAAC,IAAI,IAAG,eAAe;WAClD;CACF,CAAC,CAAC"}

View File

@@ -0,0 +1,28 @@
import TexParser from '../TexParser.js';
import { EnvList } from '../StackItem.js';
import { MmlNode } from '../../../core/MmlTree/MmlNode.js';
import { MmlMtable } from '../../../core/MmlTree/MmlNodes/mtable.js';
import { MmlMtd } from '../../../core/MmlTree/MmlNodes/mtd.js';
import { EmpheqBeginItem } from './EmpheqConfiguration.js';
export declare const EmpheqUtil: {
environment(parser: TexParser, env: string, func: Function, args: any[]): void;
splitOptions(text: string, allowed?: {
[key: string]: number;
}): EnvList;
columnCount(table: MmlMtable): number;
cellBlock(tex: string, table: MmlMtable, parser: TexParser, env: string): MmlNode;
topRowTable(original: MmlMtable, parser: TexParser): MmlNode;
rowspanCell(mtd: MmlMtd, tex: string, table: MmlMtable, parser: TexParser, env: string): void;
left(table: MmlMtable, original: MmlMtable, left: string, parser: TexParser, env?: string): void;
right(table: MmlMtable, original: MmlMtable, right: string, parser: TexParser, env?: string): void;
adjustTable(empheq: EmpheqBeginItem, parser: TexParser): void;
allowEnv: {
equation: boolean;
align: boolean;
gather: boolean;
flalign: boolean;
alignat: boolean;
multline: boolean;
};
checkEnv(env: string): boolean;
};

View File

@@ -0,0 +1,179 @@
"use strict";
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmpheqUtil = void 0;
var ParseUtil_js_1 = __importDefault(require("../ParseUtil.js"));
var TexParser_js_1 = __importDefault(require("../TexParser.js"));
exports.EmpheqUtil = {
environment: function (parser, env, func, args) {
var name = args[0];
var item = parser.itemFactory.create(name + '-begin').setProperties({ name: env, end: name });
parser.Push(func.apply(void 0, __spreadArray([parser, item], __read(args.slice(1)), false)));
},
splitOptions: function (text, allowed) {
if (allowed === void 0) { allowed = null; }
return ParseUtil_js_1.default.keyvalOptions(text, allowed, true);
},
columnCount: function (table) {
var e_1, _a;
var m = 0;
try {
for (var _b = __values(table.childNodes), _c = _b.next(); !_c.done; _c = _b.next()) {
var row = _c.value;
var n = row.childNodes.length - (row.isKind('mlabeledtr') ? 1 : 0);
if (n > m)
m = n;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
return m;
},
cellBlock: function (tex, table, parser, env) {
var e_2, _a;
var mpadded = parser.create('node', 'mpadded', [], { height: 0, depth: 0, voffset: '-1height' });
var result = new TexParser_js_1.default(tex, parser.stack.env, parser.configuration);
var mml = result.mml();
if (env && result.configuration.tags.label) {
result.configuration.tags.currentTag.env = env;
result.configuration.tags.getTag(true);
}
try {
for (var _b = __values((mml.isInferred ? mml.childNodes : [mml])), _c = _b.next(); !_c.done; _c = _b.next()) {
var child = _c.value;
mpadded.appendChild(child);
}
}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_2) throw e_2.error; }
}
mpadded.appendChild(parser.create('node', 'mphantom', [
parser.create('node', 'mpadded', [table], { width: 0 })
]));
return mpadded;
},
topRowTable: function (original, parser) {
var table = ParseUtil_js_1.default.copyNode(original, parser);
table.setChildren(table.childNodes.slice(0, 1));
table.attributes.set('align', 'baseline 1');
return original.factory.create('mphantom', {}, [parser.create('node', 'mpadded', [table], { width: 0 })]);
},
rowspanCell: function (mtd, tex, table, parser, env) {
mtd.appendChild(parser.create('node', 'mpadded', [
this.cellBlock(tex, ParseUtil_js_1.default.copyNode(table, parser), parser, env),
this.topRowTable(table, parser)
], { height: 0, depth: 0, voffset: 'height' }));
},
left: function (table, original, left, parser, env) {
var e_3, _a;
if (env === void 0) { env = ''; }
table.attributes.set('columnalign', 'right ' + (table.attributes.get('columnalign') || ''));
table.attributes.set('columnspacing', '0em ' + (table.attributes.get('columnspacing') || ''));
var mtd;
try {
for (var _b = __values(table.childNodes.slice(0).reverse()), _c = _b.next(); !_c.done; _c = _b.next()) {
var row = _c.value;
mtd = parser.create('node', 'mtd');
row.childNodes.unshift(mtd);
mtd.parent = row;
if (row.isKind('mlabeledtr')) {
row.childNodes[0] = row.childNodes[1];
row.childNodes[1] = mtd;
}
}
}
catch (e_3_1) { e_3 = { error: e_3_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_3) throw e_3.error; }
}
this.rowspanCell(mtd, left, original, parser, env);
},
right: function (table, original, right, parser, env) {
if (env === void 0) { env = ''; }
if (table.childNodes.length === 0) {
table.appendChild(parser.create('node', 'mtr'));
}
var m = exports.EmpheqUtil.columnCount(table);
var row = table.childNodes[0];
while (row.childNodes.length < m)
row.appendChild(parser.create('node', 'mtd'));
var mtd = row.appendChild(parser.create('node', 'mtd'));
exports.EmpheqUtil.rowspanCell(mtd, right, original, parser, env);
table.attributes.set('columnalign', (table.attributes.get('columnalign') || '').split(/ /).slice(0, m).join(' ') + ' left');
table.attributes.set('columnspacing', (table.attributes.get('columnspacing') || '').split(/ /).slice(0, m - 1).join(' ') + ' 0em');
},
adjustTable: function (empheq, parser) {
var left = empheq.getProperty('left');
var right = empheq.getProperty('right');
if (left || right) {
var table = empheq.Last;
var original = ParseUtil_js_1.default.copyNode(table, parser);
if (left)
this.left(table, original, left, parser);
if (right)
this.right(table, original, right, parser);
}
},
allowEnv: {
equation: true,
align: true,
gather: true,
flalign: true,
alignat: true,
multline: true
},
checkEnv: function (env) {
return this.allowEnv.hasOwnProperty(env.replace(/\*$/, '')) || false;
}
};
//# sourceMappingURL=EmpheqUtil.js.map

File diff suppressed because one or more lines are too long