Function
transformLatex
(
latex: string,
transform: (e: any) => any
)
Source from the content-addressed store, hash-verified
| 46 | |
| 47 | // Helper to parse LaTeX and apply a transformation |
| 48 | function 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 |
| 58 | function fuLatex(latex: string): string { |
Callers
nothing calls this directly
Tested by
no test coverage detected