mathnet / mathnet-symbolics

Math.NET Symbolics
http://symbolics.mathdotnet.com
MIT License
349 stars 66 forks source link

LaTeX formatter skips multiplication sign in cases where it is required (was: Algebraic.Expand erratic behaviour) #13

Closed JWebber closed 8 years ago

JWebber commented 8 years ago

Consider using the Algebraic.Expand method to expand a binomial like the following: (1+(2*3^(1/2))x)^2 - I would expect an answer of the form 1 + (4*3^(1/2))x + 12x^2, but instead I get '43^(1/2)' and '43x^2' in each case (having run through LaTeX.Format) - it is clear that there is a missing multiplication sign here. Not sure if this is my usage or an issue with the library.

cdrnet commented 8 years ago

The LaTeX formatter intentionally avoids rendering multiplications signs, but in this case there clearly should be one. This is a bug in the LaTeX module. Thanks for reporting this!

If I use the Infix module to format the result of Algebraic.expand on this term, I get 1 + 4*3^(1/2)*x + 12*x^2 which seems to be in line what you expected, so expand seems to behave correctly.

cdrnet commented 8 years ago

Fixed in #16, thanks!