Ticket #6677 (closed defect: fixed)
[with patch, positive review] Sequence doesn't know how to typeset itself
| Reported by: | burcin | Owned by: | burcin |
|---|---|---|---|
| Priority: | minor | Milestone: | sage-4.1.2 |
| Component: | misc | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | Reviewers: | John Palmieri | |
| Authors: | Burcin Erocal | Merged in: | Sage 4.1.2.alpha0 |
| Dependencies: | Stopgaps: |
Description
It seems that Sequence objects forgot how to typeset themselves somewhere between 3.4.2 and 4.1.
In 3.4.2:
sage: res = solve(x^2-2,x)
sage: latex(res)
\left[x = -\sqrt{ 2 },
x = \sqrt{ 2 }\right]
In 4.1:
sage: latex(res)
\text{[
x == -sqrt(2),
x == sqrt(2)
]}
sage: latex(res[0])
x = -\sqrt{2}
Attached patch adds a _latex_ method to sage.structure.sequence.Sequence.
Attachments
Change History
comment:2 Changed 4 years ago by jhpalmieri
- Priority changed from major to minor
- Reviewers set to John Palmieri
- Summary changed from [with patch, needs review] Sequence doesn't know how to typeset itself to [with patch, positive review] Sequence doesn't know how to typeset itself
Okay, I see why this used to work and doesn't anymore: we used to test elements when formatting for LaTeX using isinstance(x, list), and sequences returned True for this. Now we test using type(x) and looking it up in a dictionary, and there is no entry for "sage.structure.sequence.Sequence". The patch here solves the problem for sequences and includes a doctest. I have a trivial referee's patch (adds 'r' to the triple quotes at the beginning of the docstring, since there are backslashes in it).
Changed 4 years ago by jhpalmieri
-
attachment
trac_6677-referee.patch
added
apply on top of the other patch

Trac doesn't let me upload the patch. Here it is if anybody wants to review it in the meantime:
http://sage.math.washington.edu/home/burcin/trac_6677-sequence_latex.patch