Jerome Lacoste wrote:
Hi all,
We're trying to find a way to get sage to generate latex
representation of numeric expressions without fully evaluating them.
For example this would allow us to do something like render 1+5 in
latex as $1+5$ instead of 6.
Can someone tell us if it's possible to achieve this goal ? Maybe by
doing something like
var('a')
var('b')
sage_exp("a + b", locals={'a': 1, 'b': 5})
This may require adding new code.
I prefer to discuss design upfront. I am new to the project.
I've been looking a bit at the sage.symbolic.expression class.
What about a syntax like:
sage: var('a,b', hold=True)
sage: (a+b).subs(a=5,b=1)
1+5
where the "hold" attribute on a variable indicates that no
simplifications should be done with that variable, until some special
compute function like evaluate or something is called that specifically
ignores the holds.
(a+b).subs(a=5,b=1).evaluate()
6
Thanks,
Jason
--
Jason Grout
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org