as-com / wp-katex

Integrates the fast KaTeX LaTeX typesetter with WordPress
https://andrewsun.com/projects/wp-katex/
GNU General Public License v2.0
9 stars 5 forks source link

Bizzare error rendering a particular equation #8

Closed delip closed 8 years ago

delip commented 8 years ago

For this equation:

[latex display="true"] \mathcal{L}_0 = \frac{1}{2}f(x_{ij})(w_i^\intercal \tilde{w}_j - \mathbf{pmi}(i, j))^2 [/latex]

I get the following error:

ParseError: KaTeX parse error: Unexpected character: '–' at position 64: al \tilde{w}_j ̲– \mathbf{pmi}

However, in the same equation if I flip the minus (-) to a plus (+), as in:

[latex display="true"] \mathcal{L}_0 = \frac{1}{2}f(x_{ij})(w_i^\intercal \tilde{w}_j + \mathbf{pmi}(i, j))^2 [/latex]

the equation parses and renders correctly. Isn't that strange? What could be going on here?

as-com commented 8 years ago

Eww, it's WordPress's texturizer changing it to an em-dash. I'm going to attempt a fix now.

as-com commented 8 years ago

I pushed a fix to the WordPress plugin repo. You should be able to find the update on your dashboard in a few moments. :smile: