feat: LaTeX rendering
Open 💬 4 comments Opened Jul 30, 2026 by haskallcurry
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What variant of Codex are you using?
CLI
What feature would you like to see?
Proposal: render LaTeX in the Codex TUI
<img width="1853" height="1375" alt="Image" src="https://github.com/user-attachments/assets/5d5c1638-fa03-4543-b5ee-b4815e32fc8d" />
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
/petsfeature; - 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_
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Thank you very much for taking the time @haskallcurry! In the next days I will be reviewing the PR and trying to land an adaptation soon. I will fully credit you when I do!
Funny, because I did it too (but in a different way)
https://github.com/openai/codex/issues/32828#issuecomment-5122106859
@fcoury-oai FYI
+1. Super annoying seeing raw Latex.
It should be switchable with alt+r by the way, not sure if you implemented that?