Skip to content

[WIP] Add live LaTeX / math preview support in editor#97

Draft
Codex wants to merge 2 commits intomainfrom
codex/add-live-latex-math-preview
Draft

[WIP] Add live LaTeX / math preview support in editor#97
Codex wants to merge 2 commits intomainfrom
codex/add-live-latex-math-preview

Conversation

@Codex
Copy link
Copy Markdown
Contributor

@Codex Codex AI commented Apr 18, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.


This section details on the original issue you should resolve

<issue_title>Feature Request: Live LaTeX / Math Preview</issue_title>
<issue_description>## Feature Request: Live LaTeX / Math Preview

Problem

GitHub natively supports LaTeX math rendering in comments using $...$ (inline) and $$...$$ (block) syntax via MathJax. However, the extension currently has no preview support for LaTeX. Math expressions are shown as raw text while editing, breaking the WYSIWYG experience.

Expected Behavior

Math expressions should render live in the editor, matching what GitHub will display after submission/in preview:

  • Inline: $E = mc^2$$E = mc^2$ (rendered inline math)
  • Block:
$$
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$


$$\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}$$
(rendered as a math block in a new line)

Suggested Implementation

Since the editor is already built on ProseMirror, prosemirror-math with KaTeX could be a good fit — it provides inline and block math node support with live rendering and is well-maintained.

Context

This would be especially useful for users writing math-heavy issues, discussions, or PR reviews (e.g. in scientific/ML/engineering repos).</issue_description>

Comments on the Issue (you are @codex[agent] in this section)

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 18, 2026

⚠️ No Changeset found

Latest commit: 48bfdbf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Codex Codex AI linked an issue Apr 18, 2026 that may be closed by this pull request
@riccardoperra
Copy link
Copy Markdown
Owner

@codex[agent] consider to use https://prosekit.dev/extensions/math/ which already defines node and inline blocks. The extension should be added in the general markdown schema with his own test files, matching all other nodes. Also use this as a reference: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions

Co-authored-by: riccardoperra <37072694+riccardoperra@users.noreply.github.com>
@riccardoperra
Copy link
Copy Markdown
Owner

@codex[agent] consider to use https://prosekit.dev/extensions/math/ which already defines node and inline blocks. The extension should be added in the general markdown schema with his own test files, matching all other nodes. Also use this as a reference: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Live LaTeX / Math Preview

2 participants