1 | initial version |
I found a hack that "works sufficiently well" (but requires to put a symbolic link in your working directory). It goes as follows:
ln -s .sage/temp/ ./tmp_sage_cells
def my_view(e,density=150,extra=""):
tf=tmp_filename(name="png_cell",ext=".png")
sage.misc.latex.png(e,tf,density=density)
pretty_print(html('<img src="http://localhost:8888/tree/tmp_sage_cells/%s" %s>'%(tf.split(r".sage/temp/")[1],extra)))
(I'm sorry I don't know the syntax to display the code more nicely)
You can test the function with my_view(graphs.CompleteGraph(4))
or my_view(graphs.CompleteGraph(4),density=50,extra='style="height:100px;"')
for fancier options. This function my_view is a small variation from the functions defined in /sagemath/local/lib/python2.7/site-packages/sage/misc/latex.py
2 | No.2 Revision |
I found a hack that "works sufficiently well" (but requires to put a symbolic link in your working directory). It goes as follows:
ln -s .sage/temp/ ./tmp_sage_cells
def
my_view(e,density=150,extra=""):
my_view(e,density=150,extra=""):
tf=tmp_filename(name="png_cell",ext=".png")
tf=tmp_filename(name="png_cell",ext=".png")
sage.misc.latex.png(e,tf,density=density)
sage.misc.latex.png(e,tf,density=density)
pretty_print(html('<img src="http://localhost:8888/tree/tmp_sage_cells/%s" %s>'%(tf.split(r".sage/temp/")[1],extra)))
(I'm sorry I don't know the syntax to display the code more nicely)
You can test the function with my_view(graphs.CompleteGraph(4))
or my_view(graphs.CompleteGraph(4),density=50,extra='style="height:100px;"')
for fancier options. This function my_view is a small variation from the functions defined in /sagemath/local/lib/python2.7/site-packages/sage/misc/latex.py
3 | No.3 Revision |
I found a hack that "works sufficiently well" (but requires to put a symbolic link in your working directory). It goes as follows:
ln -s .sage/temp/ ./tmp_sage_cells
defmy_view(e,density=150,extra=""):my_view(e,density=150,extra=""):tf=tmp_filename(name="png_cell",ext=".png")tf=tmp_filename(name="png_cell",ext=".png")sage.misc.latex.png(e,tf,density=density)sage.misc.latex.png(e,tf,density=density) pretty_print(html('<img src="http://localhost:8888/tree/tmp_sage_cells/%s"%s>'%(tf.split(r".sage/temp/")[1],extra)))%s>'%(tf.split(r".sage/temp/")[1],extra)))(I'm sorry I don't know the syntax to display the code more nicely)
You can test the function with my_view(graphs.CompleteGraph(4))
or my_view(graphs.CompleteGraph(4),density=50,extra='style="height:100px;"')
for fancier options. This function my_view is a small variation from the functions defined in /sagemath/local/lib/python2.7/site-packages/sage/misc/latex.py
4 | No.4 Revision |
I found a hack that "works sufficiently well" (but requires to put a symbolic link in your working directory). It goes as follows:
ln -s .sage/temp/ ./tmp_sage_cells
def my_view(e,density=150,extra=""):
tf=tmp_filename(name="png_cell",ext=".png")
sage.misc.latex.png(e,tf,density=density)
pretty_print(html('<img src="http://localhost:8888/tree/tmp_sage_cells/%s" %s>'%(tf.split(r".sage/temp/")[1],extra)))
You can test the function with my_view(graphs.CompleteGraph(4))
or my_view(graphs.CompleteGraph(4),density=50,extra='style="height:100px;"')
for fancier options. This function my_view is a small variation from the functions defined in /sagemath/local/lib/python2.7/site-packages/sage/misc/latex.py