Ticket #10592 (new enhancement)
Opened 2 years ago
Create shortcut for making LaTeX from command line
|Reported by:||kcrisman||Owned by:||was|
|Component:||user interface||Keywords:||latex command line notebook|
|Cc:||jhpalmieri, jason||Work issues:|
At ask.sagemath, we see the question of
In a notebook cell one can write: %latex Hello \ [ x=f(x) \ ] 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)\ ]")
The best answer was
Latex().eval(r"""Hello \[ x=f(x) \] Goodbye""", globals=globals)
from John Palmieri.
Of course, this requires some import statement and the raw string. We should be able to make a shortcut for this; the original poster's latex_render() seems appropriate, or some variant on this. We'll have to be sure to document the raw string issue.
I'm putting this under user interface because it improves it, but really it's perhaps graphics? Well...