mkrphys / ipython-tikzmagic

IPython magics for generating figures with TikZ
BSD 3-Clause "New" or "Revised" License
160 stars 44 forks source link

Improve error handling #36

Closed MatrixManAtYrService closed 2 years ago

MatrixManAtYrService commented 2 years ago

I'm not sure what changed between 2015 and now, but when I use ipython-tikzmagic without the contents of this PR, I end up seeing the output of pdflatex whether or not there's an error. subprocess.call forwards the subprocess stdout to the process stdout and then something (I'm not sure what) relays it to the notebook. It makes users think that something is wrong when it isn't.

Screenshot from 2021-12-12 13-27-08

If I had to guess, I'd say that this is an ipython feature that was added since 2015, but I don't have proof of that. This caused me to go in a wild goose chase resolving the pictured warning, when I could've just ignored the warning.

This PR does the following:

MatrixManAtYrService commented 2 years ago

Here's what errors look like if this PR is accepted.

Screenshot from 2021-12-12 14-19-53