typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.53k stars 56 forks source link

[Feature] Support GitHub-style ```math blocks #5556

Open tonyduan opened 1 year ago

tonyduan commented 1 year ago

GitHub now renders LaTeX expressions in Markdown using MathJax.

[Link to documentation]

Unfortunately they do not support traditional math blocks, i.e. the following will not work.

$$
F = ma
$$

Instead for GitHub we need to wrap math blocks in ``math syntax like the below.

```math
F = ma
```

Would be great if this could be supported by Typora.

flokno commented 1 year ago

This is possible now, see https://github.blog/2022-05-19-math-support-in-markdown/ , but typora doesn't play nicely with it because of https://github.com/typora/typora-issues/issues/5787

Example:

$$ F = ma $$

mikedeskevich commented 1 year ago

I'll add a vote up for unifying Typora and GitHub math. I have a bunch of personal documents where I use

$$
math here
$$

and it appears that GitHub doesn't render that nicely. But it does render

$$ math here $$

as a block, which Typora doesn't seem to do.

I'm happy either way, I'd just like it to be consistent, so I can edit locally in Typora and push to GitHub and have it all be pretty.

abnerlee commented 7 months ago

relates #1405

abbotware commented 7 months ago

incredible that such a simple bug can be open for so many years!- i bought this product expecting it to work for Markdown editing locally so i could publish to github as well.

I dont care for the github ''' block notation... but the fact that github does support $$ means it should be even 'easier' to add a checkbox in the settings so when a mathblock exsits, on 'save' (or export, etc) t inserts a linebreak BEFORE the mathblock to make it render correctly. see: https://github.com/typora/typora-issues/issues/5787

I tested this and just by inserting a blank line before the mathblock, my expression appears in github now...