LaTeXTree class

The main class for building and manipulating mathematical expressions.

LaTeXTree provides a user-friendly interface for constructing complex math expressions programmatically. It abstracts the underlying tree structure, managing the cursor and active node automatically.

Use this class to add, remove, and navigate through elements of an expression.

Constructors

LaTeXTree()
Creates a new, empty math expression tree.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addChildLeaf(LEType type, String content) → void
Adds a leaf element (e.g., number, operator) to the expression at the current cursor position.
addChildNode(LEType type, {String content = ''}) → void
Adds a structural node (e.g., fraction, root) to the expression at the current cursor position.
clear() bool
Clears the entire expression tree, resetting it to an empty state.
delete() bool
Deletes the element immediately to the left of the cursor.
moveDown() bool
Moves the cursor down to a child node or a node in a lower position.
moveLeft() bool
Moves the cursor one position to the left.
moveRight() bool
Moves the cursor one position to the right.
moveUp() bool
Moves the cursor up to the parent node or a node in an upper position.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toLaTeXString() String
Returns the full LaTeX string representation of the expression.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited