orsharir / github-mathjax

Chrome extension for rendering LaTeX equations in GitHub with MathJax
Other
153 stars 49 forks source link

Indices of square brackets break expressions #12

Closed lucidyan closed 7 years ago

lucidyan commented 7 years ago

For example $$\mathbb{E}[\Delta \theta^2 ]t$$ $$\mathbb{E}[\Delta \theta^2]{t - 1}$$

orsharir commented 7 years ago

It's a limitation of adding math in as a post-processing step on Github -- it's due to the processing of underline as part of Markdown for italicized text. If you escape the underlines with a slash, i.e. \_, then it does work. As example if you use the following code instead:

$$\mathop{\mathbb{E}}[\Delta \theta^2 ]\_t$$
$$E[\Delta \theta^2]\_{t - 1}$$

then you get:

$$\mathop{\mathbb{E}}[\Delta \theta^2 ]_t$$ $$E[\Delta \theta^2]_{t - 1}$$

lucidyan commented 7 years ago

Oh, thanks, i've got it! When i was writing that issue, I mention that if equations was delimited by new line, then escaping underscore is not even needed.

$$\mathbb{E}[\Delta \theta^2 ]_t$$

$$\mathbb{E}[\Delta \theta^2]_{t - 1}$$