Show More
@@ -35,6 +35,9 b' def print_basic_unicode(o, p, cycle):' | |||
|
35 | 35 | def print_png(o): |
|
36 | 36 | """A funciton to display sympy expression using LaTex -> PNG.""" |
|
37 | 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 | 41 | png = latex_to_png(s, encode=True) |
|
39 | 42 | return png |
|
40 | 43 |
@@ -78,6 +78,8 b' class RichIPythonWidget(IPythonWidget):' | |||
|
78 | 78 | elif data.has_key('image/png'): |
|
79 | 79 | self._append_plain_text(self.output_sep) |
|
80 | 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 | 83 | # TODO: try/except these calls |
|
82 | 84 | png = decodestring(data['image/png']) |
|
83 | 85 | self._append_png(png) |
General Comments 0
You need to be logged in to leave comments.
Login now