TeX

public sealed class TeX
Provides a set of constants and utility methods used during TeX typesetting.

Fields

Aleph0

#
public const long Aleph0 = 1000000
Indicates infinite level 0 demerits.

Aleph1

#
public const long Aleph1 = 10000000
Indicates infinite level 1 demerits.

Aleph2

#
public const long Aleph2 = 100000000
Indicates infinite level 2 demerits.

RunBreakPenalty

#
public const long RunBreakPenalty = 100000
Penalty for breaking a line inside a code or mathematics run. A formula reads far better whole, so this is set high enough that the breaker will exhaust every alternative first, yet below Aleph0 so that it stays legal. An outright prohibition would produce overfull lines for formulae too wide to fit, whereas a steep price degrades gracefully.

SubscriptScale

#
public const float SubscriptScale = 0.6666
Represents the scaling factor for a subscript or superscript font.

Methods

ComputeBadnessDemerits

#
public static long ComputeBadnessDemerits(double ratio)
Compute the TeX badness metric for a line based on the amount of shrinking/stretching it is subject to.
ratio (double)Adjustment ratio.

ComputeFlaggedDemerits

#
public static long ComputeFlaggedDemerits(ITeXElement a, ITeXElement b)
Compute the demerit factor due to two consecutive lines both ending in discretionaries.
a (ITeXElement)Last element on line A.
b (ITeXElement)Last element on line B.

ComputeStretchCategory

#
public static LineStretchClass ComputeStretchCategory(double ratio)
Compute the stretching category of a line as controlled by the glue adjustment ratio. TeX tries to avoid having adjacent lines with wildly differing stretch categories.
ratio (double)

ComputeStretchDemerits

#
public static long ComputeStretchDemerits(LineStretchClass a, LineStretchClass b)
Compute the demerits due to differing stretch categories of adjacent lines.

FontMatchXHeight

#
public static Font FontMatchXHeight(Font font, float x)
Ensure a specific font is resized to match a given x-height.
font (Font)
x (float)

FontToSuperScript

#
public static Font FontToSuperScript(Font font)
Shrink a font to subscript or superscript size.
font (Font)

InfinityClass

#
public static int InfinityClass(long value)
Gets the infinity class of a value.
value (long)Value to test.

Negative Aleph 2 = -3

Negative Aleph 1 = -2

Negative Aleph 0 = -1

Not infinite = 0

Positive Aleph 0 = +1

Positive Aleph 1 = +2

Positive Aleph 2 = +3

IsInfinite

#
public static bool IsInfinite(double value)
Tests whether a value is considered infinite.
value (double)

IsInfinite

#
public static bool IsInfinite(long value)
Tests whether a value is considered infinite.
value (long)