Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing parentheses in LaTeX output #12799

Closed
jamesluke opened this issue Jun 24, 2017 · 1 comment
Closed

Missing parentheses in LaTeX output #12799

jamesluke opened this issue Jun 24, 2017 · 1 comment

Comments

@jamesluke
Copy link

jamesluke commented Jun 24, 2017

The LaTeX output of diff(sin(x)+cos(x), x, x)) is missing parentheses, producing incorrect output. The output looks like -sin(x) + cos(x), instead of the correct -(sin(x) + cos(x)). The internal representation is correct.

The output of repr(...) is '-(sin(x) + cos(x))'
The output of srepr(...) is "Mul(Integer(-1), Add(sin(Symbol('x')), cos(Symbol('x'))))"
The (incorrect) output of latex(...) is '- \\sin{\\left (x \\right )} + \\cos{\\left (x \\right )}'

screenshot

@asmeurer
Copy link
Member

I believe this is fixed in master

>>> latex(diff(sin(x)+cos(x), x, x))
'- (\\sin{\\left (x \\right )} + \\cos{\\left (x \\right )})'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants