You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our docs mention that we should use the $$ syntax for equation blocks:
$$I = \int_0^{2\pi} \sin(x)\,dx$$
But in reality, this syntax is non-ideal and is extending Markdown/MDX with a syntax that is not natively supported. An MDX document with the equation above will not compile unless remark-math is installed, so that document is less portable and will usually fail to compile with external tools that expect native MDX.
(I noticed while working on #11779: Crowdin would reject that document due to unescaped { inside the $$ equation)
In reality, using fenced code blocks also works and looks to be a much better alternative:
When dealing with markdown, you optionally use remark-math, or alternatively use fenced code (```math). Then, you either use rehype-katex or rehype-mathjax to render math in HTML.
The extra syntax extension supported by remark-math for math in markdown does not work everywhere so it makes markdown less portable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLA SignedSigned Facebook CLApr: documentationThis PR works on the website or other text documents in the repo.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Our docs mention that we should use the
$$syntax for equation blocks:But in reality, this syntax is non-ideal and is extending Markdown/MDX with a syntax that is not natively supported. An MDX document with the equation above will not compile unless remark-math is installed, so that document is less portable and will usually fail to compile with external tools that expect native MDX.
(I noticed while working on #11779: Crowdin would reject that document due to unescaped
{inside the$$equation)In reality, using fenced code blocks also works and looks to be a much better alternative:
See also https://github.com/remarkjs/remark-math
Test Plan
Preview
Test links
https://deploy-preview-11784--docusaurus-2.netlify.app/