tex

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: Apache-2.0, MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tex implements the TeX math frontend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Macro

type Macro struct {
	Body string
	Args int
}

Macro is a host-provided TeX macro.

Args is the number of undelimited arguments, from zero through nine.

type Options

type Options struct {
	Macros map[string]Macro
	Limits source.Limits
}

Options configure TeX parsing. Map keys in Macros may be supplied with or without the leading backslash.

type Result

type Result struct {
	Root        ir.Node
	Tags        []ir.EquationTag
	Diagnostics []source.Diagnostic
	Arena       *irarena.Arena
}

Result is a recoverable parse result.

func Parse

func Parse(src string, mode ir.Mode, opts Options) (result Result)

Parse lowers TeX source into the neutral IR.

Malformed input produces diagnostics and recoverable IR. Parse only panics if an internal invariant is broken; the public boundary converts such a panic into a diagnostic and a drawable fallback.

Jump to

Keyboard shortcuts

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