How do I add $E=mc^2$
math to be rendered with mathjax/katex inside a CSS class? I am trying to use this inside the following classes in markdown:
.theorem {
display: block;
font-style: italic;
}
.theorem:before {
content: "Theorem. ";
font-weight: bold;
font-style: normal;
}
.theorem[text]:before {
content: "Theorem (" attr(text) ") ";
}
e.g.
<div class="theorem" data-text="Foo"> bar is $\alpha = \beta$.
</div>
But it fails to render the example provided.
EDIT: turns out, for math in $...$
to be rendered inside the <div>
class, a line has to be skipped.
e.g.
<div class="theorem" data-text="Foo">
Given $a, b$:
$$a = b$$
</div>