#384 closed defect (fixed)
[with patch, positive review] latex formatting issues with symbolic expressions
Reported by: | jbmohler | Owned by: | was |
---|---|---|---|
Priority: | minor | Milestone: | sage-2.10.1 |
Component: | calculus | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | Work issues: | ||
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
There are two latex formatting issues for the symbolic expressions.
1) The \cdot's for implicit multiplication take up a lot of room and confuse my eyes.
2) I have expressions which are a product of about 5 things and they are output with excessive parentheses, for example: (((1+a)(1+b))(1+c))(1+d) The parenthesis check in the code just adds parentheses if the left subexpression contains a minus or plus. Of course, it should check if there is a minus or plus that isn't already bracketed or something like that (but, who am I to claim to know what should be done :) ).
Attachments (4)
Change History (11)
comment:1 Changed 14 years ago by
- Milestone set to sage-2.9
comment:2 Changed 13 years ago by
Changed 13 years ago by
comment:3 Changed 13 years ago by
- Summary changed from latex formatting issues with symbolic expressions to [with patch, needs review] latex formatting issues with symbolic expressions
See the patch. A few comments:
- The parenthesis issue is, I believe, taken care of.
- After some thinking, I decided to do away with all the \cdot's. For a while, I thought they might still been needed in some situations, but since in the default behavior _latex_ first simplifies the expressions, all the weird cases I could think of (e.g. f=cos*(x-1)) are taken care of automatically. I'd be happy to change my mind if anyone can prove me wrong.
Some examples:
sage: var('x,y') (x, y) sage: f=(x+y)*(x-y)*(x^2-2)*(y^2-3) sage: latex(f) {{{\left( {x}^{2} - 2 \right) \left( x - y \right)} \left( y + x \right)} \left( {y}^{2} - 3 \right)} sage: latex(cos*(x+1)) {\left( x + 1 \right) \cos} sage: latex(x^2*2*cos(x+1)) {{{ sage: var('x,y') (x, y) sage: f=(x+y)*(x-y)*(x^2-2)*(y^2-3) sage: latex(f) {{{\left( {x}^{2} - 2 \right) \left( x - y \right)} \left( y + x \right)} \left( {y}^{2} - 3 \right)} sage: latex(cos*(x+1)) {\left( x + 1 \right) \cos} sage: latex(x^2*2*cos(x+1)) {{2 {x}^{2} } \cos \left( x + 1 \right)} }}}
Changed 13 years ago by
comment:4 Changed 13 years ago by
Added a patch to be applied after Alex's.
comment:5 Changed 13 years ago by
- Summary changed from [with patch, needs review] latex formatting issues with symbolic expressions to [with patch, positive review] latex formatting issues with symbolic expressions
comment:6 Changed 13 years ago by
- Resolution set to fixed
- Status changed from new to closed
Merged in Sage 2.10.1.rc1
Changed 13 years ago by
Changed 13 years ago by
comment:7 Changed 13 years ago by
The two doctest patches fix the issue in the documentation and the sage library. They have been merged in Sage 2.10.1.rc1.
Cheers,
Michael
This is still an issue with Sage 2.10:
We really ought to fix this.
Cheers,
Michael