diff --git a/IPython/qt/console/rich_ipython_widget.py b/IPython/qt/console/rich_ipython_widget.py index 5d84e9a..e9d3776 100644 --- a/IPython/qt/console/rich_ipython_widget.py +++ b/IPython/qt/console/rich_ipython_widget.py @@ -129,7 +129,11 @@ class RichIPythonWidget(IPythonWidget): self._append_html(self.output_sep2, True) elif 'text/latex' in data: self._pre_image_append(msg, prompt_number) - png = latex_to_png(data['text/latex'], wrap=False) + try: + png = latex_to_png(data['text/latex'], wrap=False) + except Exception: + self.log.error("Failed to render latex: %r", data['text/latex'], exc_info=True) + png = None if png is not None: self._append_png(png, True) self._append_html(self.output_sep2, True)