Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown math support (Latex) #10899

Closed
1 task done
Vagab opened this issue Apr 23, 2024 · 5 comments
Closed
1 task done

Markdown math support (Latex) #10899

Vagab opened this issue Apr 23, 2024 · 5 comments
Labels
feature [core label] language An umbrella label for all programming languages syntax behaviors markdown renderer markdown Markdown markup support

Comments

@Vagab
Copy link
Contributor

Vagab commented Apr 23, 2024

Check for existing issues

  • Completed

Describe the feature

Would be cool if markdown preview rendered math as well

If applicable, add mockups / screenshots to help present your vision of the feature

No response

@Vagab Vagab added admin read feature [core label] labels Apr 23, 2024
@Moshyfawn Moshyfawn added markdown Markdown markup support language An umbrella label for all programming languages syntax behaviors and removed triage labels Apr 23, 2024
@Moshyfawn Moshyfawn changed the title Markdown math support Markdown math support (Latex) Apr 29, 2024
@fwcd fwcd mentioned this issue Jul 10, 2024
1 task
@ferntheplant
Copy link

It seems like this would be very non-trivial to implement. Zed uses its own customer renderer so they'd have to make a LaTeX renderer that produces something like MathElement. I didn't dig super deep into that side of the equation but think that once that is done it would be relatively easy to regex match for $ enclosed text and render MathElement as part of the render_markdown_text sequence that currently calculates highlights and generates interactive text elements for hyperlinks.

@bbb651
Copy link
Contributor

bbb651 commented Jul 20, 2024

pulldown-cmark added support for it so should be easy on the parsing front. Rendering Layout is a lot more complicated, the only potentially useful reference I've found is typst's implementation.

@bitfield
Copy link

Just to give an idea of what this might look like (screenshot from the VS Code Markdown Preview extension).

The markup:

1.11 Neptunium. In the fall of 2002, a group of scientists at Los Alamos National Laboratory determined 
that the critical mass of neptunium-237 is about 60 kg. The critical mass of a fissionable material is the 
minimum amount that must be brought together to start a chain reaction. This element has a density of 
19.5 g/cm^3. What would be the radius of a sphere of this material that has a critical mass?

Volume of the critical sphere $$ V_{crit} = 60,000 / 19.5 = 3077cm^3 = \frac{4\pi r^3}{3} $$

So

$$ R_{crit} = \sqrt[3]{\frac{3 \times 3077}{4 \pi}} = 9cm \; ✅ $$

Rendering:

Screenshot 2024-08-22 at 18 41 51

@bersace
Copy link
Contributor

bersace commented Feb 4, 2025

codestral produce markdown math. Very hard to read in assistant panel:

Image

@probably-neb
Copy link
Contributor

This is definitely a neat idea, but as @ferntheplant probably non-trivial to implement given our custom renderer.

I'd definitely be interested in seeing this in the markdown renderer, especially as we get more support for Jupyter notebooks that would benefit from this kind of thing.

In order to keep track of this i'm going to convert this to a discussion because we've decided to move feature/enhancement requests there so it will be more likely someone from the team will see it there when looking for new features to add

@zed-industries zed-industries locked and limited conversation to collaborators Feb 4, 2025
@probably-neb probably-neb converted this issue into discussion #24224 Feb 4, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
feature [core label] language An umbrella label for all programming languages syntax behaviors markdown renderer markdown Markdown markup support
Projects
None yet
Development

No branches or pull requests

8 participants