parseAndLayout method
Parse and lay out latex, returning a DisplayList.
displayMode — true (default) for display/block style ($$...$$);
false for inline/text style ($...$).
color sets the default formula color; explicit LaTeX colors still take precedence.
This is a synchronous, CPU-bound call. For long formulas, use compute with ratexParseAndLayoutInIsolate:
final dl = await compute(
ratexParseAndLayoutInIsolate,
RaTeXParseAndLayoutIsolateArgs(
latex: tex,
displayMode: true,
colorArgb: 0xFF000000, // 32-bit ARGB (e.g. [Color]`.value` at runtime)
),
);
ratexParseAndLayoutInIsolate also accepts the legacy record shape
RaTeXParseAndLayoutArgs (colorValue instead of RaTeXParseAndLayoutIsolateArgs.colorArgb).
Implementation
DisplayList parseAndLayout(
String latex, {
bool displayMode = true,
Color color = const Color(0xFF000000),
}) => _ffi.parseAndLayout(
latex,
displayMode: displayMode,
color: _toRaTeXColor(color),
);