convert static method

String convert(
  1. LatexNode node, {
  2. bool displayMode = true,
})

Converts a LaTeX AST to a complete MathML string node AST root node displayMode Whether to use display mode (block or inline)

Implementation

static String convert(LatexNode node, {bool displayMode = true}) {
  final visitor = MathMLVisitor();
  final body = visitor.visit(node);
  final display = displayMode ? "block" : "inline";
  return '<math xmlns="http://www.w3.org/1998/Math/MathML" display="$display">$body</math>';
}