feat: LaTeX rendering

Open
#36,233 5 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
latex, rust

Research direction

Start by reviewing the prototype branch feat/kitty-latex-ratex and the existing /pets feature referenced in the proposal, then trace how the Codex TUI handles terminal graphics. Done means supporting the listed LaTeX delimiters, RaTeX-based rendering, Kitty graphics output, and the documented inline-math limitations without requiring an external TeX installation.

Written by the indexing model from the issue text.

Description

CLI enhancement TUI
What variant of Codex are you using?

CLI

What feature would you like to see?

Proposal: render LaTeX in the Codex TUI

Image
Background

LaTeX rendering has been requested previously. I recently shared a prototype on twitter, which was positively received, and @fcoury invited me to contribute it.

I cannot open a PR as it is restricted to collaborators, however my implementation can be found here:

https://github.com/haskallcurry/codex/tree/feat/kitty-latex-ratex

Implementation

The implementation:

  • recognizes explicitly delimited display and inline math while excluding Markdown code;
  • renders it in-process using RaTeX, a Rust implementation of KaTeX-style mathematical layout;
  • displays the resulting images using the Kitty graphics protocol, similar to the existing /pets feature;
  • does not require an external TeX installation or renderer process.

Using KaTeX directly would require an HTML/CSS layout and rasterization engine.

Known limitations
  • Inline images must fit terminal-cell geometry, and their baseline alignment varies somewhat between terminal implementations. Inline math is therefore rendered in Unicode whenever possible.
  • Native terminal selection copies the Kitty Unicode-placeholder cells rather than the original LaTeX source.
Additional information

No response

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.