-
Notifications
You must be signed in to change notification settings - Fork 994
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
Support for mathematical expressions in Markdown #12009
Comments
Related: pypa/readme_renderer#214 |
This is blocked on pypa/readme_renderer#214 (but this does work for reStructuredText now since #12062) |
🥳 I'm very excited to report that the work done to enable MathJax on the frontend now automatically detects the Using the provided project, we can now see that the previously submitted content renders as Math (that I don't fully understand, but who cares?! 😆 ):
We could add them as configuration, if we want: https://docs.mathjax.org/en/latest/input/tex/delimiters.html#tex-delimiters but should consider the potential downsides of a sentence like:
GitHub docs recommend using html to split and make it work like so: To split <span>$</span>100 in half, we calculate $100/2$ We'd have to ask ourselves what's the likelihood of an equation being inline with an expected dollar sign. |
Wow, that's great! Thank you! For the inline dollar sign problem, I think that the benefits of having inline LaTeX outweigh the corner case of a dollar sign in the same sentence. I would say that people who chose to use LaTeX math in their README.md will probably detect this problem when rendering locally or on GitHub/GitLab their markdown file, which will push them to try and find a solution on their own. Moreover, it would be nice, from my point of view, if we match the GitHub syntax, and thus allow inline LaTeX. Great work, anyway! Thanks again! |
We can configure MathJax to detect the convention of single dollar signs in addition to its other methods, as it's not on by default. The inline script needs to be supported by our CSP, and if the stanza ever changes, we'll need to recalculate the hash and update the CSP accordingly. Resolves pypi#12009 Resolves pypa/readme_renderer#214 Signed-off-by: Mike Fiedler <miketheman@gmail.com>
We can configure MathJax to detect the convention of single dollar signs in addition to its other methods, as it's not on by default. The inline script needs to be supported by our CSP, and if the stanza ever changes, we'll need to recalculate the hash and update the CSP accordingly. Resolves #12009 Resolves pypa/readme_renderer#214 Signed-off-by: Mike Fiedler <miketheman@gmail.com> Signed-off-by: Mike Fiedler <miketheman@gmail.com> Co-authored-by: Ee Durbin <ewdurbin@gmail.com>
What's the problem this feature will solve?
GitHub has started supporting mathematical expressions in Markdown.
It would be nice to have the same possibility in PyPi, since oftentimes the
README.md
on GitHub is used aslong_description
insetup.py
.Describe the solution you'd like
Implement the same syntax used by GitHub, described here.
Additional context
Example PyPi package for which math expressions are not rendered: https://pypi.org/project/sourcespec/ (section: "Theoretical background").
The original
README.md
on GitHub: https://github.com/SeismicSource/sourcespec/blob/master/README.mdThe text was updated successfully, but these errors were encountered: