ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 26 Dec 2019 15:54:13 +0100The function "view(" doesn't seem to work with jupyter notebookhttps://ask.sagemath.org/question/49209/the-function-view-doesnt-seem-to-work-with-jupyter-notebook/I'm sorry if the question was already answered somewhere, but I did not find out an answer by myself:
In the "old" sagemath notebooks, there was a function "view" to display latex that MathJax cannot display. For instance the sage documentation proposes the following:
from sage.graphs.graph_latex import setup_latex_preamble
setup_latex_preamble()
latex.engine('pdflatex')
latex.add_to_mathjax_avoid_list('tikzpicture')
view(graphs.CompleteGraph(4))
* In the "old" sage notebook, this produces a png version of a graph (compiled from latex), which is inserted into the output of the cell
* In the Jupyter netbook, by contrast, it opens a pdf version of the graph into an external window.
Is there some way to obtain, in the Jupyter notebook, the same behaviour as in the "old netbook" ?
ThanksSebastienThu, 26 Dec 2019 15:54:13 +0100https://ask.sagemath.org/question/49209/Typesetting text in TeX view()https://ask.sagemath.org/question/9041/typesetting-text-in-tex-view/Is there a standard way to typeset TeX formulas together with normal text via view()?
So far I've been using
tex_string = "\hbox{- stationary points: }"
for pt in stats:
tex_string += latex(pt)
tex_string += ", "
view(tex_string)
where `stats` is a list of some points (defined with formulas).MathemageThu, 07 Jun 2012 13:36:23 +0200https://ask.sagemath.org/question/9041/How do i display a derivative using view()https://ask.sagemath.org/question/29671/how-do-i-display-a-derivative-using-view/ I can currently display the form of an integral in latex using:
f(x) = x + x^2
view( integral(f(x),x, hold=True) ) #displays the form of the derivative
But i can't figure out how to do it for a derivative:
f(x) = x + x^2
view( derivative(f(x),x, hold=True) ) #fails
view( derivative(f(x),x) ) # takes derivative then displays answer instead of the problem
Is their any easy way to do this? If not, whats the recommended way to fake it (inline latex etc)?gsonnenfFri, 02 Oct 2015 10:17:12 +0200https://ask.sagemath.org/question/29671/print LaTeX in notebook from scripthttps://ask.sagemath.org/question/9357/print-latex-in-notebook-from-script/I've read through
www.sagemath.org/doc/tutorial/latex.html
but still can't seem to find the equivalent to using "view" or "pretty-print" to display equations at LaTeX in a notebook cell when running a Python script from the notebook. (I do have "Typeset" checked at the start of the notebook.) For example, suppose my file foo.py has a function:
def show_all(self):
y = var('y')
x = 2.0*y**2
view(x)
pretty_print(x)
show(x)
JSMath()(x)
JSMath().eval(x)
print JSMath()(x)
print JSMath().eval(x)
html(JSMath()(x))
html(JSMath().eval(x))
print html(JSMath()(x))
print html(JSMath().eval(x))
Running this function from a notebook cell returns lines of the form either
\newcommand{\Bold}[1]{\mathbf{#1}}2.0 \, y^{2}
or
\newcommand{\Bold}[1]{\mathbf{#1}}2.0 \, y^{2}
</font></html>
But I just want a nice LaTeX display of 2*y***2 equivalent to typing (from a notebook cell)
view(2.0*y**2)
which returns
2.00000000000000y2 (prettier than this of course)
So I'm still missing the right combination of LaTeX library functions. As a follow-up question, is dealing with LaTeX macros the only way to get the "2.00000000000" in the above to display as 2.0, 2.00, etc.?burningbrightThu, 27 Sep 2012 19:35:22 +0200https://ask.sagemath.org/question/9357/compile TeX from Sagehttps://ask.sagemath.org/question/9165/compile-tex-from-sage/Hola!
I'm working on a program which should output the results of its computations in form of a typesetted document (ideally pdf from *pdflatex*).
I'm trying to perfrom the final presentation part via `view` function, however, that doesn't seem to be the most convenient way (since `view` is aimed at typesetting **LaTeX** formulas of elements of a list). A lot of *hidden code* (headers, turned on math modes etc.) are really unpleasent to get around.
I'm pondering about generating an explicit `.tex` source code file. How can I call TeX compiler from Sage? I.e. how to compile it automatically in an own program, similarly as `view` does it?)
ThanX in advance!
Sage 5.1
Kubuntu 12.04MathemageFri, 20 Jul 2012 09:00:23 +0200https://ask.sagemath.org/question/9165/