mathnet / mathnet-symbolics

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

[Q] Output formatting for the expression. #27

Closed FoggyFinder closed 3 years ago

FoggyFinder commented 7 years ago

The output for LaTeX is similar as in Infix.format. But this format looks not always beautiful.

For example:

let value = "(cos(tan(sqrt(x))))/(2*sqrt(x)*cos(sqrt(x))^2) "
let expr = value |> Infix.parseOrUndefined

let format = expr |> Infix.format
let latex = expr |> LaTeX.format

//\frac{\frac{1}{2}{x}^{\left(-\frac{1}{2}\right)}\cos{\tan{\sqrt[2]{x}}}}{{\left(\cos{\sqrt[2]{x}}\right)}^{2}}

2

Question: might make sense to change the formatting to the more familiar form for the LaTeX?

3

FoggyFinder commented 3 years ago

LaTeX.formatVisual does that