josdejong / josdejong/mathjs

Weird LaTeX representation of sin^2 x

Open
#2,899 5 comments 0 reactions 0 assignees View on GitHub
Needs more information question
Dominant language
JavaScript
Stars
15.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
LaTeX representation of sin^2 x depends on the way how the squared sinus was got.

**To Reproduce**
```js
math.parse('(sin(x))^2').toTex()
"{\\left(\\sin\\left( x\\right)\\right)}^{2}"

math.parse('sin(x)*sin(x)').toTex()
"\\sin\\left( x\\right)\\cdot\\sin\\left( x\\right)"

math.simplify(math.parse('sin(x)*sin(x)')).toTex()
"{\\sin\\left( x\\right)}^{2}"

math.simplify(math.parse('(sin(x))^2')).toTex()
"{\\sin\\left( x\\right)}^{2}"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.