Export to GitHub

sympy - issue #2784

1/function() should be printed differently by latex printer


Posted on Oct 25, 2011 by Grumpy Cat

In [1]: latex(1/cos(x)) Out[1]: \operatorname{cos}^{-1}\left(x\right)

In [2]: pprint(1/cos(x)) 1
────── cos(x)

[1] should output \frac{1}{\operator ...}

Comment #1

Posted on Oct 30, 2011 by Happy Elephant

(No comment was entered for this change.)

Comment #2

Posted on Nov 9, 2011 by Happy Elephant

(No comment was entered for this change.)

Comment #3

Posted on Nov 20, 2011 by Massive Elephant

It is not ease to fix, because it is related with "medium" issue 2552

In [1]: 1/cos(x) Out[1]: 1/cos(x)

In [2]: (1/cos(x)).args Out[2]: (cos(x), -1)

issue 2552: substitution does not work for (1/(x*y)).subs(x*y, 2) because :

In [15]: a = 1/(x*y)

In [16]: a.args Out[16]: ⎛1 1⎞ ⎜─, ─⎟ ⎝x y⎠

Comment #4

Posted on Nov 20, 2011 by Happy Elephant

(No comment was entered for this change.)

Comment #5

Posted on Nov 21, 2011 by Happy Elephant

I don't think that's related. All that needs to be done here is to check the sign of the exponent. The logic can (and should) be copied from the pretty printer/string printer.

Comment #6

Posted on Nov 22, 2011 by Massive Dog

pull request 736

Comment #7

Posted on Nov 23, 2011 by Happy Elephant

(No comment was entered for this change.)

Comment #8

Posted on Mar 5, 2014 by Happy Elephant

We have moved issues to GitHub https://github.com/sympy/sympy/issues.

Comment #9

Posted on Apr 6, 2014 by Happy Rabbit

Migrated to http://github.com/sympy/sympy/issues/5883

Status: Fixed

Labels:
Type-Defect Priority-Medium Printing CodeInCategory-Code CodeInDifficulty-Medium CodeInImportedIntoMelange PassedReview Restrict-AddIssueComment-Commit