[IPython-dev] Problems with tikzmagic and svg output

Michael Kraus michael.kraus at ipp.mpg.de
Tue Dec 9 03:49:26 EST 2014


Hi,

Thanks for the fix. However, while svg works fine now, it seems that png and jpg output is broken.

I inserted a switch to set the isolated tag only for svg output. The updated files can be found at

http://www.ipp.mpg.de/~mkraus/python/tikzmagic.py
http://www.ipp.mpg.de/~mkraus/python/tikzmagic_test.ipynb

The latest version also includes the possibility to specify TikZ libraries.


Cheers,
Michael



> On 22.10.2014, at 00:55, David Powell <DavidAnthonyPowell+python at gmail.com> wrote:
> 
> 
> I suppose you should display it in an iframe, if you display the SVG with the isolated=true metadata,
> IPython should do that for you automatically.
> 
> 
> Thanks, this was a fairly easy modification to the magic
> 
> 
> > On a related point, is there an easy way to export the .svg output of a cell to a file directly from within the notebook? I know that I could use nbconvert, manually hack the html, or find the temporary svg created by the magic, but I was hoping to find a more convenient way.
> 
> No, no easy way. For most content, drag-and drop from Chrome to my desktop seem to work here.
> I was able to do it with SVG at some point, but today it refuses.
> --
> 
> That's a pity, it would be nice to have a general solution to this problem for arbitrary data displayed in the cell output. Perhaps some kind of widget which runs nbconvert and selects the output from one cell would be a solution. For this specific tikz magic, the easiest thing was to add an extra argument to save a copy of the file.
> 
> Anyway, I have created a modified version of this tikz magic with these two fixes, shared here in case it is useful to anybody else:
> 
> https://gist.github.com/DavidPowell/84655e9a87fdfdaf2717 <https://gist.github.com/DavidPowell/84655e9a87fdfdaf2717>
> 
> 
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20141209/b085716d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20141209/b085716d/attachment.sig>


More information about the IPython-dev mailing list