distillpub / template

This is the repository for the distill web framework
http://distill.pub/guide/
Apache License 2.0
810 stars 133 forks source link

Equation numbering in template.v2.js? #122

Open hrbigelow opened 4 years ago

hrbigelow commented 4 years ago

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

martinpflaum commented 3 years ago

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