##// END OF EJS Templates
Small fixes for latex/png printing....
Brian Granger -
Show More
@@ -35,6 +35,9 b' def print_basic_unicode(o, p, cycle):'
35 def print_png(o):
35 def print_png(o):
36 """A funciton to display sympy expression using LaTex -> PNG."""
36 """A funciton to display sympy expression using LaTex -> PNG."""
37 s = latex(o, mode='inline')
37 s = latex(o, mode='inline')
38 # mathtext does not understand \\operatorname to we remove it so functions
39 # like sin, cos can print. We should possible replace it with mathrm.
40 s = s.replace('\\operatorname','')
38 png = latex_to_png(s, encode=True)
41 png = latex_to_png(s, encode=True)
39 return png
42 return png
40
43
@@ -78,6 +78,8 b' class RichIPythonWidget(IPythonWidget):'
78 elif data.has_key('image/png'):
78 elif data.has_key('image/png'):
79 self._append_plain_text(self.output_sep)
79 self._append_plain_text(self.output_sep)
80 self._append_html(self._make_out_prompt(prompt_number))
80 self._append_html(self._make_out_prompt(prompt_number))
81 # This helps the output to look nice.
82 self._append_plain_text('\n')
81 # TODO: try/except these calls
83 # TODO: try/except these calls
82 png = decodestring(data['image/png'])
84 png = decodestring(data['image/png'])
83 self._append_png(png)
85 self._append_png(png)
General Comments 0
You need to be logged in to leave comments. Login now