Opened 10 years ago

Closed 10 years ago

#6401 closed defect (fixed)

[with patch, positive review] Typesettings of real() and imag() are broken

Reported by: gmhossain Owned by: burcin
Priority: major Milestone: sage-4.1.1
Component: symbolics Keywords:
Cc: Merged in: Sage 4.1.1.rc1
Authors: Burcin Erocal Reviewers: Golam Mortuza Hossain
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

Typesetting of real() and imag() methods are broken due to missing parenthesis.

sage: latex(x.real())
\Rex

"\Rex" is not a valid latex expression. It should be something like "\Re\left(x\right)".

Similar issues are present also for Symbolic functions

sage: f(x) = function('f',x)
sage: latex( f(x).imag())
\Imf\left(x\right)

Again it should be similar to "\Im\left(f\left(x\right)\right)".

Attachments (1)

trac_6401-real_imag_typesetting.patch (1.3 KB) - added by burcin 10 years ago.
doctest fixes for typesetting changes in pynac

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by burcin

doctest fixes for typesetting changes in pynac

comment:1 Changed 10 years ago by burcin

  • Authors set to Burcin Erocal
  • Milestone set to sage-4.1.1
  • Owner changed from (none) to burcin
  • Status changed from new to assigned

I have a fix for this in my local pynac tree. I will make a new package with a few more bugfixes available soon.

comment:2 Changed 10 years ago by burcin

  • Summary changed from Typesettings of real() and imag() are broken to [with patch, needs review] Typesettings of real() and imag() are broken

This now depends on the package linked from #6404.

Please follow the instructions on that ticket to apply & test.

comment:3 Changed 10 years ago by gmhossain

Hi Burcin,

I am testing out the new pynac spkg. Seems alright to me so far. Out of curiosity: is there any reason to print the extra spaces around the the argument of real() and imag()?

sage: latex(real(x))
\Re \left( x \right)

Given it differs a bit from your earlier convention for default typesetting of symbolic function

sage: psi(x) = function('psi',x)
sage: latex(psi(x))
\psi\left(x\right)

Otherwise, I am ready to give positive review as the output is valid latex expression in both cases.

comment:4 Changed 10 years ago by burcin

There is no specific reason I chose that format. We can change it in the future if we decide on a convention.

comment:5 Changed 10 years ago by gmhossain

  • Reviewers set to Golam Mortuza Hossain
  • Summary changed from [with patch, needs review] Typesettings of real() and imag() are broken to [with patch, positive review partial] Typesettings of real() and imag() are broken

Note: I am giving partial positive review because I tested this patch against my stable sage-4.1. So if it applies cleanly on Sage-4.1.1.rc1 then that would be full positive from me.

comment:6 Changed 10 years ago by mvngu

  • Merged in set to Sage 4.1.1.rc1
  • Resolution set to fixed
  • Status changed from assigned to closed
  • Summary changed from [with patch, positive review partial] Typesettings of real() and imag() are broken to [with patch, positive review] Typesettings of real() and imag() are broken

I applied patches in the following order:

  1. the spkg pynac-0.1.8.p2.spkg at #6404
  2. trac_6404-conjugate_typesetting.patch
  3. trac_6401-real_imag_typesetting.patch
  4. trac_6377-exp_infinity.patch
  5. trac_6243-fderivative_hash.patch

All doctests pass in my merge tree. So I'm changing #6404, #6401, #6377 and #6243 to positive review as per Golam's request.

Note: See TracTickets for help on using tickets.