TeXBody
ReferencesImplementation of the TeX style glue-box-penalty model for a body of text, as outlined by Donald Knuth and Michael Plass in their seminal 1981 paper 'Breaking Paragraphs into Lines'. Append elements to this stream using the Add() methods and eventually break it into lines with the BestBreak() method.
Constructors
Properties
WillBeginNewClause
#Gets whether the next element to be appended will be the start of a new clause. This means the most recent element of type Box contains text ending in a clause terminator such as full stop, comma, or colon. Note that the first clause of a paragraph does not qualify as a new clause.
Indexers
this[]
#Gets the specified TeX element. When indexed outside of the valid range, this method always returns a Box with zero width.
Methods
AddPlainContent
#Parse and append text to this body. The text isn't interpreted in any way, only whitespace is replaced with the appropriate glue and penalties.
AddTeXContent
#Parse and append TeX formatted content to this body. The text is interpreted using a subset of TeX macros: \emph{}, \code{}, \math{}, \sub{}, \super{}, \colour[name]{}, ...
Macro names are all lower case and are matched case-sensitively. An unrecognised macro renders as its own name, backslash included, in TeXStateMachine.InvalidColour, so that mistakes are visible rather than silently changing the formatting.
EnsureParagraphEnding
#Ensure that the current text validly terminates in a paragraph ending so it can be properly broken into lines.
public void EnsureParagraphEnding()