Ask Your Question

converting expressions into latex code

asked 2011-04-09 00:36:47 -0500

ebs gravatar image

updated 2011-05-12 09:13:23 -0500

Kelvin Li gravatar image

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?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2011-04-09 09:42:53 -0500

benjaminfjones gravatar image

updated 2011-04-09 10:03:12 -0500

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)
sage: sin(2*pi, hold=True)

But the limit function doesn't take this parameter.

edit flag offensive delete link more


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 gravatar imagekcrisman ( 2011-04-11 17:10:19 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-04-09 00:36:47 -0500

Seen: 268 times

Last updated: Apr 09 '11