##// END OF EJS Templates
Document print_png and print_display_png
Takafumi Arakaki -
Show More
@@ -45,7 +45,9 b' def print_basic_unicode(o, p, cycle):'
45
45
46
46
47 def print_png(o):
47 def print_png(o):
48 """A function to display sympy expression using LaTex -> PNG."""
48 """
49 A function to display sympy expression using inline style LaTeX in PNG.
50 """
49 s = latex(o, mode='inline')
51 s = latex(o, mode='inline')
50 # mathtext does not understand certain latex flags, so we try to replace
52 # mathtext does not understand certain latex flags, so we try to replace
51 # them with suitable subs.
53 # them with suitable subs.
@@ -56,9 +58,13 b' def print_png(o):'
56
58
57
59
58 def print_display_png(o):
60 def print_display_png(o):
59 """A function to display sympy expression using LaTex -> PNG."""
61 """
62 A function to display sympy expression using display style LaTeX in PNG.
63 """
60 s = latex(o, mode='plain')
64 s = latex(o, mode='plain')
61 s = s.strip('$')
65 s = s.strip('$')
66 # As matplotlib does not support display style, dvipng backend is
67 # used here.
62 png = latex_to_png('$$%s$$' % s, backend='dvipng')
68 png = latex_to_png('$$%s$$' % s, backend='dvipng')
63 return png
69 return png
64
70
General Comments 0
You need to be logged in to leave comments. Login now