Opened 3 years ago

Last modified 2 years ago

#27078 new PLEASE CHANGE

Latex version of piecewise is cumbersome

Reported by: gh-JCGoran Owned by:
Priority: minor Milestone:
Component: user interface Keywords: latex
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


The latex produced by the piecewise function is rather cumbersome to look at. For instance:

sage: var('y'); f = piecewise([((0,1), x^2*y), ([-1,0], -x*y^2)], var=x);
sage: latex(f)
piecewise\left(\left(\left(\text{\texttt{(0,{ }1)}}, x^{2} y\right), \left(\text{\texttt{[{-}1,{ }0]}}, -x y^{2}\right)\right), x\right)

which looks very strange when rendered in a document. On the other hand, something like this

\operatorname{piecewise}(x) = \begin{cases}x^2y, & x\in (0, 1)\\ -xy^2, & x\in [-1, 0]\\ \end{cases}

is much easier to understand when rendered.

Attachments (1)

piecewise.png (11.8 KB) - added by gh-JCGoran 3 years ago.
Piecewise current versus proposed Latex

Download all attachments as: .zip

Change History (3)

Changed 3 years ago by gh-JCGoran

Piecewise current versus proposed Latex

comment:1 Changed 3 years ago by embray

  • Milestone changed from sage-8.7 to sage-8.8

Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually)

comment:2 Changed 2 years ago by embray

  • Milestone sage-8.8 deleted

As the Sage-8.8 release milestone is pending, we should delete the sage-8.8 milestone for tickets that are not actively being worked on or that still require significant work to move forward. If you feel that this ticket should be included in the next Sage release at the soonest please set its milestone to the next release milestone (sage-8.9).

Note: See TracTickets for help on using tickets.