diff --git a/IPython/extensions/sympy_printing.py b/IPython/extensions/sympy_printing.py index c7d6cd7..648032e 100644 --- a/IPython/extensions/sympy_printing.py +++ b/IPython/extensions/sympy_printing.py @@ -35,6 +35,9 @@ def print_basic_unicode(o, p, cycle): def print_png(o): """A funciton to display sympy expression using LaTex -> PNG.""" s = latex(o, mode='inline') + # mathtext does not understand \\operatorname to we remove it so functions + # like sin, cos can print. We should possible replace it with mathrm. + s = s.replace('\\operatorname','') png = latex_to_png(s, encode=True) return png diff --git a/IPython/frontend/qt/console/rich_ipython_widget.py b/IPython/frontend/qt/console/rich_ipython_widget.py index 4a5dcda..9657f8d 100644 --- a/IPython/frontend/qt/console/rich_ipython_widget.py +++ b/IPython/frontend/qt/console/rich_ipython_widget.py @@ -78,6 +78,8 @@ class RichIPythonWidget(IPythonWidget): elif data.has_key('image/png'): self._append_plain_text(self.output_sep) self._append_html(self._make_out_prompt(prompt_number)) + # This helps the output to look nice. + self._append_plain_text('\n') # TODO: try/except these calls png = decodestring(data['image/png']) self._append_png(png)