Documentation
¶
Overview ¶
Package latex renders a basic subset of LaTeX math as terminal-friendly Unicode text. It is a faithful port of upstream pi's tui/src/latex.ts: renderLatex returns the rendered string and true, or ("", false) when the expression contains unsupported or malformed syntax (pi's `undefined`).
The static lookup tables live in symbols.go, generated from the pinned upstream source by internal/latex/gentables. Ports packages/tui/src/latex.ts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderLatex ¶
func RenderLatex(source string, opts RenderLatexOptions) (string, bool)
RenderLatex renders a LaTeX math expression to Unicode text, aligning matrices and cases in both modes and stacking fractions, operator limits, and unsupported scripts in display mode. The bool is false (upstream `undefined`) for unsupported or malformed input.
Types ¶
type RenderLatexOptions ¶
type RenderLatexOptions struct {
// Display stacks fractions and operator limits vertically (default: false).
Display bool
}
RenderLatexOptions mirrors upstream RenderLatexOptions.
Directories
¶
| Path | Synopsis |
|---|---|
|
Command gentables extracts the static lookup tables from upstream pi's tui/src/latex.ts into Go source (symbols.go), so the LaTeX->Unicode port never hand-transcribes ~230 symbol rows.
|
Command gentables extracts the static lookup tables from upstream pi's tui/src/latex.ts into Go source (symbols.go), so the LaTeX->Unicode port never hand-transcribes ~230 symbol rows. |