parpalak / i.upmath.me

Upmath LaTeX Renderer
https://i.upmath.me/
MIT License
54 stars 9 forks source link

">" and "<" printing as "gt;" "lt;" \begin{aligned} prints "amp;" #18

Closed GuillermoBasoco closed 3 years ago

GuillermoBasoco commented 3 years ago

Hi @parpalak,

I've tested this excelent library with two latex versions:

In both cases, I found a problem with the ">" "<" characters and the \begin{aligned} directive. For example, the following formula is printed as follows:

$$ \begin{equation} \begin{aligned} F ={} & {F{x} \in F{c} : (|S| > |C|) \ & \cap (\mathrm{minPixels} < |S| < \mathrm{maxPixels}) \ & \cap (|S_{\mathrm{conected}}| > |S| - \epsilon)} \end{aligned} \end{equation} $$

image

In the Upmath editor, it shows perfectly:

image

Tried forcing mathmode and also disabling \write18 with no success.

Thanks.

parpalak commented 3 years ago

I think the problem is somewhere in integration between your software and Upmath. There are unnecessary escaping of the equation text before it goes to the Upmath. There is nothing wrong with LaTeX version and \write18 in your case.

GuillermoBasoco commented 3 years ago

Thanks @parpalak ! It was a problem with the htmlspecialchars() function. Problem solved