MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / transformLatex

Function transformLatex

test/compute-engine/fu.test.ts:48–55  ·  view source on GitHub ↗
(
  latex: string,
  transform: (e: any) => any
)

Source from the content-addressed store, hash-verified

46
47// Helper to parse LaTeX and apply a transformation
48function transformLatex(
49 latex: string,
50 transform: (e: any) => any
51): string | undefined {
52 const expr = ce.parse(latex);
53 const result = transform(expr);
54 return result?.latex ?? result?.toString();
55}
56
57// Helper to simplify with Fu and return LaTeX
58function fuLatex(latex: string): string {

Callers

nothing calls this directly

Calls 2

parseMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected