opencode/packages/latex/src/render.ts
2026-08-26 16:14:37 -04:00

11 lines
439 B
TypeScript

import { layoutMath } from "./layout"
import { parseLatex } from "./parser"
import type { MathLayout, RenderLatexOptions } from "./types"
export function renderLatex(source: string, options: RenderLatexOptions = {}): MathLayout {
return layoutMath(parseLatex(source, options), options)
}
export function renderLatexToString(source: string, options: RenderLatexOptions = {}): string {
return renderLatex(source, options).toString()
}