MatthewJA / Coffeequate

A computer algebra system for JavaScript.

Home Page:http://matthewja.com/Coffeequate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: CQ("-x").toLaTeX()

TenobaalTotenamsel opened this issue · comments

I get an error with the .toLaTeX function for negative terms with only one variable or one value for example:
CQ("-1").toLaTeX()
CQ("-10").toLaTeX()
CQ("-x").toLaTeX()
CQ("-10x").toLaTeX()
...{throw new Error("not implemented")...

This is a problem in prettyRender, I think. I'll have a look at it in a few weeks when I have time, but someone else can pick it up in the meantime if they'd like (I think it should be a pretty simple fix).

I believe I've found the solution to the issue. In the Negate.prototype.renderLaTeX function, the this.contents needs to be (this.contents.renderLaTeX()).

That looks like the problem! Thanks for finding it.

I don't have time to fix + test it right now, but I'll get around to doing so soon. Also happy to accept pull requests.

Thanks again to both of you for reporting and investigating this bug!