Skip to content

Add LaTeX rendering to Markdown preview#48143

Draft
MostlyKIGuess wants to merge 5 commits intozed-industries:mainfrom
MostlyKIGuess:math-render
Draft

Add LaTeX rendering to Markdown preview#48143
MostlyKIGuess wants to merge 5 commits intozed-industries:mainfrom
MostlyKIGuess:math-render

Conversation

@MostlyKIGuess
Copy link
Contributor

@MostlyKIGuess MostlyKIGuess commented Feb 1, 2026

Closes #40813

Continuing from #44525

  • add the latex_render crate using ReX to render LaTeX.
  • supports inline and display styles, bundles the Latin Modern Math font, and implements a cache.

Working based on #44525 (comment)

There are few issues which need help right now.. I am not exactly sure how we would fix the font tearing and relative sizes, I have tried to keep all the magic numbers on top of all the files to speed up work on this issue.

Release Notes:

  • Ability to render LaTeX in markdown preview.

- add the `latex_render` crate using ReX to render LaTeX.
- supports inline and display styles, bundles the Latin Modern Math
  font, and implements a cache.
- Need to handle font tearing and other related issues borrowed from ReX
  here.. from now
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 1, 2026
@MostlyKIGuess
Copy link
Contributor Author

Screenshots from the:

cargo run -p latex_render --example latex_demo
image image

Markdown Preview:

White Theme:

image

Black Theme:
image

@pkondzior
Copy link
Contributor

Awesome work!

Having inline() from #48057 would significantly improve the LaTeX renderer. It would let us render inline paragraphs properly, so blocks of text between equations would wrap coherently. Right now, a lot of content overflows especially div lines that exceed their container width and switching to inline rendering should fix that.

Screenshot 2026-02-01 at 18 23 05

@zed-industries-bot
Copy link
Contributor

zed-industries-bot commented Feb 1, 2026

Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against 76de711

- switch incorporates Windows compatibility fix
@rgbkrk rgbkrk added area:repl repl, jupyter, notebooks, etc area:preview/markdown markdown preview labels Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:preview/markdown markdown preview area:repl repl, jupyter, notebooks, etc cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support LaTex rendering in markdown preview

4 participants