math_latex_builder 1.0.6
math_latex_builder: ^1.0.6 copied to clipboard
A Dart package to programmatically build and manipulate LaTeX math expressions using a tree-based structure.
example/math_latex_builder_example.dart
import 'package:math_latex_builder/math_latex_builder.dart';
void main(List<String> args) {
final LaTeXTree tree = LaTeXTree();
tree.addChildLeaf(LEType.numberLeaf, "4");
tree.addChildLeaf(LEType.operatorLeaf, "+");
tree.addChildNode(LEType.fractionNode);
tree.addChildLeaf(LEType.numberLeaf, "1");
tree.addChildLeaf(LEType.numberLeaf, "5");
tree.addChildLeaf(LEType.operatorLeaf, "-");
tree.addChildNode(LEType.squareRootNode);
tree.addChildLeaf(LEType.numberLeaf, "7");
tree.moveDown();
tree.addChildNode(LEType.nthRootNode);
tree.addChildLeaf(LEType.numberLeaf, "9");
tree.moveRight();
tree.addChildNode(LEType.fractionNode);
tree.addChildLeaf(LEType.numberLeaf, "3");
tree.moveDown();
tree.addChildLeaf(LEType.numberLeaf, "8");
print("result : ${tree.toLaTeXString}");
// 4+\frac{15-\sqrt{7}}{\sqrt[9]{\frac{3}{8|}}}
}