A LaTeX math shell for the terminal, with a small command language that operates on LaTeX expressions. LaTeX always lives inside $…$; a bare $…$ line renders it in place with shell flow like zsh or bash and math layout from opentui-math.
texsh> $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$
╭────────
-b ± √ b² - 4ac
x = ─────────────────
2a
texsh> unicode $\mathbb{R}^n$
ℝⁿ
U+211D U+207F
texsh> unicode $\sum_{i=1}^{n} x_i^2 \leq \aleph_0$
∑ᵢ₌₁ⁿ xᵢ² ≤ ℵ₀
On Kitty-compatible terminals (Ghostty, Kitty, WezTerm) formulas also render as high-resolution MathJax graphics, with automatic Unicode-cell fallback everywhere else.
- Bun ≥ 1.3
- A real terminal for the interactive shell (
-cworks in a pipe)
bun install
bun startOr:
bun index.tsOne-shot evaluation (prints to stdout, exit code 1 on error):
bun index.ts -c 'unicode $\mathbb{R}$' # ℝ
bun index.ts -c '$e^{i\pi} + 1 = 0$' # Unicode-cell renderingline := command arg*
arg := word | '$' latex '$' | '$$' latex '$$'
| Input | What happens |
|---|---|
$…$ |
Render the expression (implicit render) |
render $…$ |
Same, explicit: aliases r, show, tex |
unicode $…$ |
Convert the expression to Unicode text and copy it to the clipboard: aliases u, uni |
copy [$…$] |
Copy the last unicode result, or the given expression's Unicode form: aliases cp, c |
help / ? |
Built-in command list |
examples |
Sample lines to try |
history |
Past inputs |
mode auto|kitty|cells |
Switch graphics backend |
clear / Ctrl+L |
Clear scrollback |
exit / Ctrl+C |
Leave the shell |
| ↑ / ↓ | Previous / next command |
Bare LaTeX without $…$ is a syntax error; the shell tells you what to wrap. Commands accept several $…$ arguments and handle each in turn.
unicode $…$ transliterates LaTeX into plain Unicode, using the Mathematical Alphanumeric Symbols block, the superscript/subscript blocks, and the usual operator code points:
| LaTeX | Unicode |
|---|---|
\mathbb{R}, \mathbb{1} |
ℝ, 𝟙 |
\mathcal{L}, \mathfrak{g}, \mathbf{x}, \mathit{x} |
ℒ, 𝔤, 𝐱, 𝑥 |
\alpha, \Omega, \varepsilon, \aleph_0 |
α, Ω, ε, ℵ₀ |
x^2, a_{ij}, e^{-x}, A^\top, 90^\circ |
x², aᵢⱼ, e⁻ˣ, Aᵀ, 90° |
\sum_{i=1}^{n}, \int_0^1 |
∑ᵢ₌₁ⁿ, ∫₀¹ |
\frac{1}{2}, \frac{5}{4}, \sqrt[3]{x}, \binom{n}{k} |
½, ⁵⁄₄, ∛x, (ⁿₖ) |
\vec{v}, \hat{x}, \overline{AB}, \not\in |
v⃗, x̂, A̅B̅, ∉ |
\forall x \in \mathbb{R}, P \implies Q |
∀x ∈ ℝ, P ⟹ Q |
\begin{pmatrix} a & b \\ c & d \end{pmatrix} |
(a b; c d) |
The result lands on your clipboard automatically (via pbcopy, wl-copy, xclip, or xsel when present, else OSC 52, which works over SSH in Ghostty, Kitty, WezTerm, and iTerm2). copy re-copies the last result, and dragging the mouse over any output copies the selection on release.
Spacing follows TeX's atom classes, so a+b=c comes out as a + b = c and \sin x as sin x. When Unicode has no form for something (a superscript π, a general fraction, a matrix) the command prints its best approximation and a ⚠ note saying what was approximated. Plain letters stay plain; use \mathit{x} for 𝑥.
- @opentui/core — terminal UI (prompt, scroll history, input)
- opentui-math — LaTeX → Unicode cells / Kitty graphics
MIT