template icon indicating copy to clipboard operation
template copied to clipboard

Equation numbering in template.v2.js?

Open hrbigelow opened this issue 4 years ago • 1 comments

Hi,

Is there a way to add equation numbers to code below? And more generally API documentation on what markdown is available inside <d-math> and <d-math block> tags?

  <d-math block>
      \begin{aligned}
      \mathbb{E}_{z \sim q_\phi(z|x)}[
      \log \dfrac{p_\theta(x, z)}{q_\phi(z|x)} + \log
      \dfrac{q_\phi(z|x)}{p_\theta(z|x)}]
      \end{aligned}
  </d-math>

A fuller example is here

Thanks very much!

Henry

hrbigelow avatar Feb 19 '20 18:02 hrbigelow

Hi distill uses katex and you can do equation numbering in katex by using its tag functionality - so \tag{14} f(x) = x*2 should work - i also programmed a compiler from latex articles to distill which does this automatically https://github.com/martinpflaum/latex_to_html

\tag{something} doesn t work in normal latex but was added to katex additionally to exactly make the numbering of the quations

martinpflaum avatar Jul 11 '21 18:07 martinpflaum