mathrender

package
v2.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package mathrender turns TeX expressions into bounded PNG previews using optional CLIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindRaTeX

func FindRaTeX(setting string) (string, error)

FindRaTeX resolves an override or verifies the PNG CLI advertised by render. The help check distinguishes its generic command name from unrelated tools.

Types

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

Renderer caches a bounded set of results for one viewer session.

func New

func New(ratex string) *Renderer

New detects optional renderers on PATH unless RaTeX is disabled or overridden.

func (*Renderer) Available

func (r *Renderer) Available() bool

func (*Renderer) Render

func (r *Renderer) Render(ctx context.Context, formula string, inline, dark bool) ([]byte, error)

Render preserves physical newlines and uses LaTeX when RaTeX is inapplicable or fails, including when its output is not a valid bounded PNG.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL