#9314: LaTeX representation of negative symbolic fractions still broken
-------------------------+--------------------------------------------------
   Reporter:  damm       |       Owner:  burcin                   
       Type:  defect     |      Status:  needs_review             
   Priority:  blocker    |   Milestone:  sage-4.5                 
  Component:  symbolics  |    Keywords:  latex, sign, minus, pynac
     Author:             |    Upstream:  N/A                      
   Reviewer:             |      Merged:                           
Work_issues:             |  
-------------------------+--------------------------------------------------
Changes (by burcin):

  * status:  new => needs_review


Comment:

 The pynac package at

 http://sage.math.washington.edu/home/burcin/pynac/pynac-0.2.0.p4.spkg

 contains a fix for this. I want to keep this as easy to review as
 possible, so the only change is the following simple patch:

 {{{
 diff --git a/ginac/mul.cpp b/ginac/mul.cpp
 --- a/ginac/mul.cpp
 +++ b/ginac/mul.cpp
 @@ -268,6 +268,10 @@
                              }
                         } else {
                              if (numer.is_equal(_ex1) ||
 numer.is_equal(_ex_1)) {
 +                                 const numeric &coeff =
 ex_to<numeric>(numer);
 +                                 if (coeff.is_equal(*_num_1_p) &&
 !coeff.is_parent_pos_char()) {
 +                                       c.s<<"-";
 +                                 }
                                  mul(others).eval().print(c);
                              } else {
 mul(numer,mul(others).eval()).hold().print(c);
 }}}

 attachment:trac_9314-latex_mul.patch has the doctest fixes for the Sage
 library.

 I will take care of the pretty printing issues from comment:3 later.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9314#comment:10>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to