public FractionAtom(Atom numerator, Atom denominator, TexUnit unit, double thickness, TexAlignment numeratorAlignment, TexAlignment denominatorAlignment) : this(numerator, denominator, unit, thickness) { this.numeratorAlignment = CheckAlignment(numeratorAlignment); this.denominatorAlignment = CheckAlignment(denominatorAlignment); }
public UnderOverAtom(Atom baseAtom, Atom underOver, TexUnit underOverUnit, double underOverSpace, bool underOverScriptSize, bool over) { SpaceAtom.CheckUnit(underOverUnit); this.BaseAtom = baseAtom; if (over) { this.UnderAtom = null; this.UnderSpace = 0; this.UnderSpaceUnit = 0; this.UnderScriptSmaller = false; this.OverAtom = underOver; this.OverSpaceUnit = underOverUnit; this.OverSpace = underOverSpace; this.OverScriptSmaller = underOverScriptSize; } else { this.UnderAtom = underOver; this.UnderSpaceUnit = underOverUnit; this.UnderSpace = underOverSpace; this.UnderScriptSmaller = underOverScriptSize; this.OverSpace = 0; this.OverAtom = null; this.OverSpaceUnit = 0; this.OverScriptSmaller = false; } }
public SpaceAtom(TexUnit unit, double width, double height, double depth) : base() { CheckUnit(unit); this.isHardSpace = false; this.widthUnit = unit; this.heightUnit = unit; this.depthUnit = unit; this.width = width; this.height = height; this.depth = depth; }
protected FractionAtom(Atom numerator, Atom denominator, bool useDefaultThickness, TexUnit unit, double thickness) { SpaceAtom.CheckUnit(unit); this.Type = TexAtomType.Inner; this.Numerator = numerator; this.Denominator = denominator; this.numeratorAlignment = TexAlignment.Center; this.denominatorAlignment = TexAlignment.Center; this.useDefaultThickness = useDefaultThickness; this.lineThicknessUnit = unit; this.lineThickness = thickness; }
public UnderOverAtom(Atom baseAtom, Atom under, TexUnit underUnit, double underSpace, bool underScriptSize, Atom over, TexUnit overUnit, double overSpace, bool overScriptSize) { SpaceAtom.CheckUnit(underUnit); SpaceAtom.CheckUnit(overUnit); this.BaseAtom = baseAtom; this.UnderAtom = under; this.UnderSpaceUnit = underUnit; this.UnderSpace = underSpace; this.UnderScriptSmaller = underScriptSize; this.OverAtom = over; this.OverSpaceUnit = overUnit; this.OverSpace = overSpace; this.OverScriptSmaller = overScriptSize; }
public void PutDelimiterUnder(TexDelimeter delimiter, string subscriptFormula, TexUnit kernUnit, double kern) { PutDelimiterUnder(delimiter, formulaParser.Parse(subscriptFormula), kernUnit, kern); }
public void AddStrut(TexUnit unit, double width, double height, double depth) { Add(new SpaceAtom(unit, width, height, depth)); }
public void AddStrut(TexUnit unit, double width, double height, double depth) { this.Add(new SpaceAtom(null, unit, width, height, depth)); }
public void PutUnder(string underFormula, TexUnit underUnit, double underSpace, bool underScriptSize) { PutUnder(underFormula == null ? null : ParseFormula(underFormula), underUnit, underSpace, underScriptSize); }
public void PutDelimiterUnder(TexDelimiter delimiter, TexFormula subscriptName, TexUnit kernUnit, double kern) { var name = TexFormulaParser.DelimiterNames[(int)delimiter][(int)TexDelimeterType.Under]; this.Formula.RootAtom = new OverUnderDelimiter( this._source, this.Formula.RootAtom, subscriptName?.RootAtom, SymbolAtom.GetAtom(name, null), kernUnit, kern, false); }
public void PutUnderAndOver(string underFormula, TexUnit underUnit, double underSpace, bool underScriptSize, string over, TexUnit overUnit, double overSpace, bool overScriptSize) { PutUnderAndOver(underFormula == null ? null : formulaParser.Parse(underFormula), underUnit, underSpace, underScriptSize, over == null ? null : formulaParser.Parse(over), overUnit, overSpace, overScriptSize); }
private double GetConversionFactor(TexUnit unit, TexEnvironment environment) { return unitConversions[(int)unit](environment); }
public static void CheckUnit(TexUnit unit) { if ((int)unit < 0 || (int)unit >= unitConversions.Length) throw new InvalidOperationException("No conversion for this unit exists."); }
public FractionAtom(Atom numerator, Atom denominator, TexUnit unit, double thickness) : this(numerator, denominator, false, unit, thickness) { }
public void PutUnder(TexFormula underFormula, TexUnit underUnit, double underSpace, bool underScriptSize) { this.Formula.RootAtom = new UnderOverAtom(this.Formula.RootAtom, underFormula == null ? null : underFormula.RootAtom, underUnit, underSpace, underScriptSize, false); }
public void PutOver(TexFormula overFormula, TexUnit overUnit, double overSpace, bool overScriptSize) { this.Formula.RootAtom = new UnderOverAtom(this.Formula.RootAtom, overFormula == null ? null : overFormula.RootAtom, overUnit, overSpace, overScriptSize, true); }
public void PutUnder(string underFormula, TexUnit underUnit, double underSpace, bool underScriptSize) { PutUnder(underFormula == null ? null : formulaParser.Parse(underFormula), underUnit, underSpace, underScriptSize); }
private double GetConversionFactor(TexUnit unit, TexEnvironment environment) { return(unitConversions[(int)unit](environment)); }
public void PutDelimiterOver(TexDelimiter delimiter, string superscriptFormula, TexUnit kernUnit, double kern) { this.PutDelimiterOver(delimiter, this.ParseFormula(superscriptFormula), kernUnit, kern); }
public void PutOver(string overFormula, TexUnit overUnit, double overSpace, bool overScriptSize) { PutOver(overFormula == null ? null : ParseFormula(overFormula), overUnit, overSpace, overScriptSize); }
public FractionAtom(SourceSpan?source, Atom?numerator, Atom?denominator, TexUnit unit, double thickness) : this(source, numerator, denominator, false, unit, thickness) { }
public void PutUnderAndOver(string underFormula, TexUnit underUnit, double underSpace, bool underScriptSize, string over, TexUnit overUnit, double overSpace, bool overScriptSize) { PutUnderAndOver(underFormula == null ? null : ParseFormula(underFormula), underUnit, underSpace, underScriptSize, over == null ? null : ParseFormula(over), overUnit, overSpace, overScriptSize); }
public void PutDelimiterOver(TexDelimeter delimiter, string superscriptFormula, TexUnit kernUnit, double kern) => PutDelimiterOver(delimiter, FormulaParser.Parse(superscriptFormula), kernUnit, kern);
public void PutDelimiterUnder(TexDelimiter delimiter, string subscriptFormula, TexUnit kernUnit, double kern) { this.PutDelimiterUnder(delimiter, this.formulaParser.Parse(subscriptFormula), kernUnit, kern); }
public void PutDelimiterOver(TexDelimeter delimiter, TexFormula superscriptFormula, TexUnit kernUnit, double kern) { var name = TexFormulaParser.DelimiterNames[(int)delimiter][(int)TexDelimeterType.Over]; Formula.RootAtom = new OverUnderDelimiter(Formula.RootAtom, superscriptFormula?.RootAtom, SymbolAtom.GetAtom(name), kernUnit, kern, true); }
public void AddStrut(TexUnit widthUnit, double width, TexUnit heightUnit, double height, TexUnit depthUnit, double depth) { Add(new SpaceAtom(widthUnit, width, heightUnit, height, depthUnit, depth)); }
public void PutOver(TexFormula overFormula, TexUnit overUnit, double overSpace, bool overScriptSize) { Formula.RootAtom = new UnderOverAtom(Formula.RootAtom, overFormula?.RootAtom, overUnit, overSpace, overScriptSize, true); }
public void PutDelimiterUnder(TexDelimeter delimiter, TexFormula subscriptName, TexUnit kernUnit, double kern) { var name = TexFormulaParser.DelimiterNames[(int)delimiter][(int)TexDelimeterType.Under]; this.Formula.RootAtom = new OverUnderDelimiter(this.Formula.RootAtom, subscriptName == null ? null : subscriptName.RootAtom, SymbolAtom.GetAtom(name), kernUnit, kern, false); }
public void PutOver(string overFormula, TexUnit overUnit, double overSpace, bool overScriptSize) => PutOver(overFormula is null ? null : FormulaParser.Parse(overFormula), overUnit, overSpace, overScriptSize);
public void PutOver(string overFormula, TexUnit overUnit, double overSpace, bool overScriptSize) { PutOver(overFormula == null ? null : formulaParser.Parse(overFormula), overUnit, overSpace, overScriptSize); }
public void AddStrut(TexUnit unit, double width, double height, double depth) => Add(new SpaceAtom(unit, width, height, depth));
public void AddStrut(TexUnit widthUnit, double width, TexUnit heightUnit, double height, TexUnit depthUnit, double depth) => Add(new SpaceAtom(widthUnit, width, heightUnit, height, depthUnit, depth));
public void PutUnderAndOver(TexFormula underFormula, TexUnit underUnit, double underSpace, bool underScriptSize, TexFormula over, TexUnit overUnit, double overSpace, bool overScriptSize) { this.Formula.RootAtom = new UnderOverAtom(this.Formula.RootAtom, underFormula == null ? null : underFormula.RootAtom, underUnit, underSpace, underScriptSize, over == null ? null : over.RootAtom, overUnit, overSpace, overScriptSize); }
private FractionAtom(Atom numerator, Atom denominator, bool useDefaultThickness, TexUnit unit, double thickness) { SpaceAtom.CheckUnit(unit); Type = TexAtomType.Inner; Numerator = numerator; Denominator = denominator; numeratorAlignment = TexAlignment.Center; denominatorAlignment = TexAlignment.Center; this.useDefaultThickness = useDefaultThickness; lineThicknessUnit = unit; lineThickness = thickness; }