Assigning to Variables§

--assign can be uses repeatedly to assign multiple formats

[1]:
%load_ext magic_call.latex
[2]:
%whos
Interactive namespace is empty.
[3]:
%%call_latex_standalone --assign png my_png_data
abc
../../_images/latex_magic_assign_3_0.png
[4]:
%whos
Variable      Type     Data/Info
--------------------------------
my_png_data   bytes    b'\x89PNG\r\n\x1a\n\x00\x<...>00\x00\x00IEND\xaeB`\x82'
[5]:
from IPython.display import Image
Image(my_png_data)
[5]:
../../_images/latex_magic_assign_5_0.png

Use --no-display if you don’t want to show the result immediately:

[6]:
%%call_latex_standalone --no-display --assign png more_png_data
abc
[7]:
Image(more_png_data)
[7]:
../../_images/latex_magic_assign_8_0.png