Add raw/rendered toggle for TeX fenced code blocks in Codex App conversations

Open 💬 0 comments Opened Aug 28, 2026 by Qubit-Fernand

What variant of Codex are you using?

Codex App / desktop conversation UI on macOS.

What feature would you like to see?

Please add a per-block toggle for TeX-like fenced code blocks in Codex App conversation output, so a user can switch between:

  • raw source view: the exact fenced source, copyable as written; and
  • rendered preview: a display-only math rendering of the same TeX content.

For example, when an assistant response contains:

````markdown

S(|\psi\rangle \oplus \Gamma|\psi\rangle)
=
U|\psi\rangle \oplus \Gamma|\psi\rangle.

````

Codex currently shows the raw tex code block, which is correct for source fidelity. But in research/paper-reading workflows, the same block is often used because it is the only reliable way to keep the TeX copyable; visually, it would be much easier to read as a rendered equation.

A small control in the code-block toolbar, next to the existing copy/open controls, could toggle that individual block between source and rendered mode. A global preference such as render_tex_code_blocks = true/false would also be useful, but the per-block toggle matters because sometimes the user really wants source code and sometimes they want readable math.

Why this matters

Codex is very useful for math-heavy research discussions, LaTeX paper editing, and proof walkthroughs. In those conversations, assistants often use fenced tex blocks to preserve exact syntax and make formulas easy to copy. That preserves correctness, but it makes equations harder to read, especially for longer expressions.

This request is slightly different from general Markdown math rendering. I am not asking Codex to automatically render all code blocks or to lose source fidelity. The desired behavior is a display-layer toggle:

  • keep the original assistant Markdown/session content unchanged;
  • keep raw source copyable and easy to inspect;
  • render only when the fence language is TeX/LaTeX-like (tex, latex, maybe math) and the content is safe/supported;
  • fall back to source view when parsing/rendering fails.

Related issues

Related but not identical:

  • #10715 requested rendered LaTeX math support in the Codex App.
  • #23402 tracks inline $...$ math rendering in Codex App conversations and Markdown preview.
  • #18906 and #39171 discuss LaTeX rendering in the CLI/TUI and mention preserving raw source / adding a raw-source toggle.

This issue is specifically for fenced TeX code blocks in the Codex App conversation UI, where source fidelity and rendered readability are both valuable.

Additional information

A concrete use case is discussing a quantum computing paper. Raw TeX such as |\psi_j\rangle \oplus O_j|x_j\rangle is useful for copying into LaTeX, but a rendered toggle would make it much easier to read during the conversation without asking the assistant to rewrite everything outside code fences.

View original on GitHub ↗