pi-terminal-math
Render LaTeX equations as terminal-native text in pi assistant messages
Package details
Install pi-terminal-math from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-terminal-math- Package
pi-terminal-math- Version
0.2.0- Published
- Jul 21, 2026
- Downloads
- 125/mo · 125/wk
- Author
- ryanress
- License
- MIT
- Types
- extension
- Size
- 35.3 KB
- Dependencies
- 1 dependency · 1 peer
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-terminal-math
pi-terminal-math renders LaTeX equations as terminal-native text in pi assistant messages. It uses Unicode characters and ordinary terminal cells rather than image protocols, so equations remain readable in terminal transcripts.
Install
pi install npm:pi-terminal-math
Restart pi or run /reload after installation.
Usage
Math rendering starts off in each session. Enable it when you need to read LaTeX output:
/math on Enable rendering
/math off Disable rendering
/math Toggle rendering
The footer shows ∑ math while rendering is enabled.
Write equations with standard LaTeX delimiters:
Inline: $x^2 + y^2 = z^2$
Display: $$CC_{\mathrm{norm}} = \frac{CC_{\mathrm{abs}}}{CC_{\max}}$$
The extension renders common notation directly in assistant output:
x² + y² = z²
CC
abs
CC = ─────
norm CC
max
It supports common fractions, roots, sums, limits, subscripts, superscripts, Greek letters, and operators. Wide expressions wrap to the available terminal width. Incomplete, malformed, or unsupported LaTeX remains visible as source text instead of interrupting the transcript.
Math inside inline code or fenced code blocks is left unchanged. Currency-like dollar expressions are not treated as math.
Scope
Rendering is available in pi's interactive TUI and defaults to off. Enabling it loads MathJax and adds brief prompt guidance encouraging display math for substantial equations. The extension does not modify stored assistant messages or add duplicate preview messages.
Development
npm install
npm test
npm run check
License
MIT