converting expressions into latex code

i like this post (click again to cancel)
1
i dont like this post (click again to cancel)

latex( (lim((sin(tan(x))-tan(sin(x)))/x^7,x=0)))

returns the latex code of the answer ie -1/30 but I want the latex code of the limit unevaluated so that I can generate an image of the question from it. How can I do this?

asked Apr 09 '11

ebs gravatar image ebs
129 1 10 15

updated May 12 '11

Kelvin Li gravatar image Kelvin Li
423 9 16
i like this answer (click again to cancel)
1
i dont like this answer (click again to cancel) ebs has selected this answer as correct

You can produce latex code for the function you are taking a limit of and then just add the limit by hand:

sage: expr = (sin(tan(x))-tan(sin(x)))/x^7
sage: latex_limit = '$\\lim_{x \\to 0}' + latex(expr) + '$'
sage: view(latex_limit)

$\lim_{x \to 0}\frac{\sin\left(\tan\left(x\right)\right) - \tan\left(\sin\left(x\right)\right)}{x^{7}}$

By the way, some expressions in Sage take an optional parameter hold which prevents evaluation of symbolic expressions, e.g.

sage: sin(2*pi)
0
sage: sin(2*pi, hold=True)
sin(2*pi)

But the limit function doesn't take this parameter.

link

posted Apr 09 '11

benjaminfjones gravatar image benjaminfjones
2470 3 33 66
http://bfj7.com/

updated Apr 09 '11

I don't know that any of our 'calculus' things do that yet, though certainly Maxima can with a prepended apostrophe. It's 'normal' functions that seem to allow that (via Pynac). Should we open a ticket for something like this? We get such unevaluated nounforms back from Maxima all the time for limits and integrals; Pynac usually can do something with derivatives. kcrisman (Apr 11 '11)

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Tags:

Stats:

Asked: Apr 09 '11

Seen: 148 times

Last updated: Apr 09 '11

powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.