Important
This documentation covers IPython versions 6.0 and higher. Beginning with version 6.0, IPython stopped supporting compatibility with Python versions lower than 3.3 including all versions of Python 2.7.
If you are looking for an IPython version compatible with Python 2.7, please use the IPython 5.x LTS release and refer to its documentation (LTS is the long term support release).
Module: core.magics.display
¶
Simple magics for display formats
1 Class¶
- class IPython.core.magics.display.DisplayMagics(**kwargs: Any)¶
Bases:
Magics
Magics for displaying various output types with literals
Defines javascript/latex/svg/html cell magics for writing blocks in those languages, to be rendered in the frontend.
- html(line, cell)¶
%html [--isolated]
Render the cell as a block of HTML
- options:
- --isolated
Annotate the cell as ‘isolated’. Isolated cells are rendered inside their own <iframe> tag
- javascript(line, cell)¶
Run the cell block of Javascript code
Starting with IPython 8.0 %%javascript is pending deprecation to be replaced by a more flexible system
- js(line, cell)¶
Run the cell block of Javascript code
Alias of
%%javascript
Starting with IPython 8.0 %%javascript is pending deprecation to be replaced by a more flexible system
- latex(line, cell)¶
Render the cell as a block of LaTeX
The subset of LaTeX which is supported depends on the implementation in the client. In the Jupyter Notebook, this magic only renders the subset of LaTeX defined by MathJax [here](https://docs.mathjax.org/en/v2.5-latest/tex.html).
- markdown(line, cell)¶
Render the cell as Markdown text block
- svg(line, cell)¶
Render the cell as an SVG literal