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
Want to make a component like theorem environment of latex
I tried to show katex math-expression in MDX components and finally did it.
But, as follows, a break line is needed when writing .mdx files.
I think it's not readable.
And also, in the result, "Theorem children" has strange margins between <div>.
I can fix it by adding styles like { margin: "-1em 0em" }, but I don't like it.
<Theoremtitle="Proposition">
This is a test for $\KaTeX$ in MDX component. If $\zeta( s )$ is Riemann zeta function,
$$\zeta(2)=\sum_{n=1}^{\infty}\frac{1}{n^{2}}=\frac{\pi^{2}}{6}.$$
</Theorem>
A break line is needed between <Theorem> and "This is...".
result
Proposition (grey back)
(yellow)
This is ...(green)
(equation, green)
(yellow)
div 1(grey)
div 2(green)
The text was updated successfully, but these errors were encountered:
The empty line is necessary and is part of the commonmarkspecification in order to open up Markdown parsing after an opening HTML/JSX tag.
The margins are likely due to styling based on paragraph tags since the Markdown inside Theorem will be parsed as a paragraph. In order to remove the margins you could add scoped styling to the Theorem component that would remove margins in a paragraph.
There's also a related MDX RFC that might be worth checking out if you want to read more into this.
Hope this helps! Let me know if you have any other questions.
Want to make a component like theorem environment of latex
I tried to show katex math-expression in MDX components and finally did it.
But, as follows, a break line is needed when writing .mdx files.
I think it's not readable.
And also, in the result, "Theorem children" has strange margins between
<div>
.I can fix it by adding styles like
{ margin: "-1em 0em" }
, but I don't like it.How to fix these?
theorem.js
mdxtest.mdx
A break line is needed between
<Theorem>
and "This is...".result

The text was updated successfully, but these errors were encountered: