Skip to content

Add LaTeX rendering to Markdown preview - #48143

Closed
MostlyKIGuess wants to merge 5 commits into
zed-industries:mainfrom
MostlyKIGuess:math-render
Closed

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

Conversation

@MostlyKIGuess

@MostlyKIGuess MostlyKIGuess commented Feb 1, 2026

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator 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
Copy Markdown
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

zed-industries-bot commented Feb 1, 2026

Copy link
Copy Markdown
Contributor
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 Feedback for Zed's Markdown preview labels Feb 10, 2026
@SomeoneToIgnore

Copy link
Copy Markdown
Contributor
image

Will close this as a stale draft with conflicts and no activity for over a month.

@MostlyKIGuess

Copy link
Copy Markdown
Collaborator Author

Hi @SomeoneToIgnore I can work on fixing the merges, although even for this PR I had used ReX from my fork because of build errors in Zed, I suppose the way Zed works around this is by having it's own forks.

I was hoping that inline would be merged before this so scaling text isn't an issue but if it's not in the roadmap -- I am happy to fix conflicts and get this MVP working.

@Arcitec

Arcitec commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Continued in #54668

Also rewritten by someone in #57339

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

Labels

area:preview/markdown Feedback for Zed's 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

6 participants