#8707: view(x) calls x._latex_() 5 times!
-----------------------+----------------------------------------------------
Reporter: nthiery | Owner: AlexGhitza
Type: defect | Status: new
Priority: major | Milestone: sage-4.4
Component: algebra | Keywords: latex
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-----------------------+----------------------------------------------------
latex(x) calls x._latex_() twice, and view(x) 5 times!!!
For small objects, that's fine, but when x is a graph, and latex'ing it
requires calling graphviz, dot2tex, ... it is not reasonable!
{{{
sage: class blah():
....: def _latex_(x):
....: print "coucou"
....: return "x"
....:
sage: latex(blah())
coucou
coucou
x
sage: view(blah())
coucou
coucou
coucou
coucou
coucou
}}}
Analysis:
- latex makes use of has_latex_expr which makes a call to _latex_ but
discards the result
- latex_file does not reuse its calls to latex(x)
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8707>
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.