explaingit

mikewang817/tformula

Analysis updated 2026-05-18

24TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A terminal tool that renders LaTeX math formulas as real images when using AI coding agents like Codex or Claude Code, instead of showing raw formula text.

Mindmap

mindmap
  root((TFormula))
    What it does
      Renders LaTeX inline
      Wraps CLI agents
      PTY proxy
    Features
      Document reader
      Formula history
      Export formats
    Tech stack
      MathJax
      Kitty graphics protocol
      Node.js
    Supported agents
      Codex
      Claude Code
      Gemini CLI
    Setup
      Install via npm
      Ghostty terminal

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

See math formulas rendered as images while chatting with an AI coding agent in the terminal

USE CASE 2

Read Markdown files with formulas, tables, and images directly in a terminal document reader

USE CASE 3

Copy the most recently rendered formula to the clipboard as LaTeX, MathML, or an image

USE CASE 4

Export a rendered formula as a high-resolution PNG or SVG file for use elsewhere

What is it built with?

TypeScriptNode.jsMathJaxKitty graphics protocol

How does it compare?

mikewang817/tformulacschanhniem/clawpingcub3y0nd/entropic
Stars242424
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderatemoderate
Complexity2/53/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires a Kitty-graphics-capable terminal such as Ghostty, Kitty, or WezTerm, plus the target CLI agent already installed.

In plain English

TFormula is a terminal tool that renders LaTeX math formulas as actual images directly inside a terminal window, when using AI coding assistants like OpenAI Codex, Claude Code, Cursor Agent, Gemini CLI, and several others from the command line. Normally, when one of these tools writes out a math formula, it shows up as raw text codes like backslash-frac, which is hard to read. TFormula sits between the terminal and the agent as a proxy: it lets the agent's program run completely normally, but it also keeps a hidden copy of what is on screen, notices when LaTeX formulas appear, renders them locally using MathJax, and overlays the rendered image on top of the text using a graphics feature built into terminals like Ghostty, Kitty, and WezTerm. The original text stays available underneath for copying. Using it is a matter of installing the tool globally through npm and then running a specific launch command for whichever agent you use, such as running Codex through 'tformula codex' instead of just 'codex'. There is no plugin or extra configuration needed beyond that, the agent itself must already be installed separately. A general-purpose shell mode can also wrap any command without needing a specific alias for every agent. Beyond wrapping AI agents, TFormula includes a full-screen document reader that can open Markdown files, plain text, or images directly from the terminal, rendering headings, formatting, tables, links, and math formulas as a readable document rather than raw text, complete with keyboard navigation for scrolling, searching, and jumping between headings. Open documents are watched for changes, so saving from an editor refreshes the view automatically. Every formula that gets rendered is saved to a local history, which can be listed, and the most recently rendered formula, or an older one by its ID, can be copied to the clipboard or saved to a file in several formats, including raw LaTeX, MathML, SVG, PNG, or TIFF, with options to control color, background, scale, and padding. All rendering happens locally on the user's machine.

Copy-paste prompts

Prompt 1
Help me install TFormula and set it up to wrap Claude Code in my terminal
Prompt 2
Show me the keyboard shortcuts for navigating the Markdown reader in TFormula
Prompt 3
Walk me through exporting the last rendered formula as a transparent PNG with a custom color
Prompt 4
Explain how TFormula detects and renders LaTeX without modifying the underlying agent

Frequently asked questions

What is tformula?

A terminal tool that renders LaTeX math formulas as real images when using AI coding agents like Codex or Claude Code, instead of showing raw formula text.

What language is tformula written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, MathJax.

How hard is tformula to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is tformula for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.