Add Math Summation

This commit is contained in:
Dolan
2019-08-20 20:40:40 +01:00
parent a1b9be453b
commit 4f8d435e16
19 changed files with 359 additions and 2 deletions

View File

@ -0,0 +1,25 @@
// http://www.datypic.com/sc/ooxml/e-m_nary-1.html
import { XmlComponent } from "file/xml-components";
import { MathRun } from "../math-run";
import { MathBase } from "./math-base";
import { MathNArayProperties } from "./math-naray-properties";
import { MathSubScript } from "./math-sub-script";
import { MathSuperScript } from "./math-super-script";
export interface IMathSumOptions {
readonly child: MathRun;
readonly subScript?: MathRun;
readonly superScript?: MathRun;
}
export class MathSum extends XmlComponent {
constructor(readonly options: IMathSumOptions) {
super("m:nary");
this.root.push(new MathNArayProperties("∑"));
this.root.push(new MathSubScript(options.child));
this.root.push(new MathSuperScript(options.child));
this.root.push(new MathBase(options.child));
}
}