In a notebook cell one can write:
and an image appear with perfect math notation. (not jsmath)
What is the sage command that does the same receiving a string ? Something like latexrender(r"Hello \ [x=f(x)\ ]")
I don't know that there is one. But from the console, you can use the text command, and wrap the latex in $:
So you can trivially write a latexrender command yourself:
Adding extra features like allowing you to specify the properties via **kwargs is left as an exercise for the reader. I should note though that the above uses matplotlib's TeX implementation, not any system verson, AFAIK.
Let's see if I can figure out how to do this from the notebook.. okay, the above still works there. I'll see if I can figure out how to get LaTeX itself called (although I should say that the matplotlib mathtext has worked pretty well for me).
After a little thought, something like the following should get the job done:
Percent directives in the notebook literally call other systems directly. (So you need $\LaTeX$ in your PATH to do this, of course, which I don't.)
So there should be a way to use the stuff in
should work for anything. Certainly it will work if you put Sage objects and numbers in it, but with strings I think it's tricky -
or the whole source for
So that's not a full answer, but maybe it will lead to a full answer. I just don't understand well enough how the notebook calls other systems, otherwise I'd look there and give a complete answer.
posted Jan 11 '11kcrisman
7427 ● 17 ● 76 ● 166
Asked: Jan 11 '11
Seen: 627 times
Last updated: Jan 17 '12
powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.