GNOME Bugzilla – Bug 599508
Misrendering of itex equations including newline characters
Last modified: 2009-11-04 20:42:50 UTC
Created attachment 146183 [details] SVG illustrating the problem For example: $$ f(x|\lambda) = \begin{cases} \lambda e^{-\lambda x} & x \geq 0, \\ 0 & \text{otherwise} \end{cases} $$ (from http://xbeta.org/wiki/show/itex+environments)
I can't replicate this bug. The sample renders fine using lasemtest or lasemrender (except for a minor error on the vertical bar which is rendered slightly slanted). How did you obtain the attached output ?
The problem turned out to be newline characters in the string passed to mathml_document_new_from_itex. If they are stripped out, all works fine.
Jorn, if you could attach a file that exhibits this behaviour using lasemrender, it would be great. I'd like to try to make lasem strip this newline characters.
Created attachment 146659 [details] [review] Crude patch to lasemrender illustrating the problem As it turns out carriage returns are to blame. I'm not sure why Python adds these to multiline literals ..
Thanks Jorn. I've pushed a fix that strips \r characters from the itex strings. Given my knowledge of flex/bison, I may have broken something else. But at least the itex files in the lasem test suite are rendered correctly.