Function

nerdamer.convertToLaTeX

src/index.ts:447
nerdamer.convertToLaTeX(expression: string | ParserEntity, options?: TeXOptions): string

Converts an expression to TeX without requiring the caller to construct a converter. String input follows the legacy source-preserving path before symbolic normalization; entity input keeps ordinary structured Converter behavior.

Parameters

NameTypeDescription
expressionstring | ParserEntityParser entity or notation string to format.
optionsTeXOptionsConverter formatting options. The legacy `'decimal'`, `'decimals'`, and `decimals: true` spellings are normalized to the 2.0 `decimal: true` option. Decimal conversion intentionally uses the evaluated Converter path.

Returns

string — TeX markup generated by the shared converter.