jupyter/qtconsole

Popup window during latex rendering

eendebakpt opened this issue · 2 comments

When displaying an object with a _repr_latex_ method a popup window is displayed (tested: qtconsole and spyder on windows).
A minimal example to trigger this

image

The popup window is not shown when directly rendering latex to png, e.g.

from IPython.lib.latextools import latex_to_png

png = latex_to_png('$1 + x + x^2$', wrap=False, backend='dvipng',
                               color='white')
png = latex_to_png('$1 + x + x^2$', wrap=False, backend='matplotlib',
                               color='white')

(this is the code in the qtconsole repo I could find that generates the images from latex)

The popup window itself is running miktex:

image

This can't be solved here but on IPython. However, it's not so hard to do it.

You need to pass the right parameters on Windows to make the subprocess.check_call calls used in the latex_to_png_dvipng function present in

https://github.com/ipython/ipython/blob/master/IPython/lib/latextools.py#L141

to not open a CMD window on execution.

You can find how to do that here:

https://stackoverflow.com/a/1016651/438386

Let us know if you can handle this on your own or need help to do it.

That solves it! I will make a PR to ipython to include it there. Thanks @ccordoba12