This notebook is meant for testing conversion to other formats.
It contains Markdown cells, code cells with different kinds of outputs and raw cells with different formats.
We can use emphasis, boldface, preformatted text
.
It looks like strike-out text is not supported:
strikethrough.
Equations can be formatted really nicely, either inline, like $\text{e}^{i\pi} = -1$, or on a separate line, like
$$ \int_{-\infty}^\infty f(x) \delta(x - x_0) dx = f(x_0) $$A | B | A and B |
---|---|---|
False | False | False |
True | False | False |
False | True | False |
True | True | True |
Relative links to local notebooks can be used: a link to a notebook in a subdirectory, a link to an orphan notebook (latter won't work in LaTeX output, because orphan pages are not included there).
This is how a link is created in Markdown:
[a link to a notebook in a subdirectory](subdir/another.ipynb)
Markdown also supports reference-style links: a reference-style link, another version of the same link.
These can be created with this syntax:
[a reference-style link][mylink]
[mylink]: subdir/another.ipynb
Links to sub-sections are also possible, e.g. this subsection.
This link was created with:
[this subsection](subdir/another.ipynb#A-Sub-Section)
You just have to remember to replace spaces with hyphens!
BTW, links to sections of the current notebook work, too, e.g. beginning of this section.
This can be done, as expected, like this:
[beginning of this section](#Links-to-Other-Notebooks)
An empty code cell:
A cell with no output:
None
A simple output:
6 * 7
The standard output stream:
print('Hello, world!')
Normal output + standard output
print('Hello, world!')
6 * 7
The standard error stream is highlighted and displayed just below the code cell. The standard output stream comes afterwards (with no special highlighting). Finally, the "normal" output is displayed.
import logging
logging.warning('I am a warning and I will appear on the standard error stream')
print('I will appear on the standard output stream')
'I am the "normal" output'
See [IPython example notebook](https://nbviewer.jupyter.org/github/ipython/ipython/blob/master/examples/IPython Kernel/Rich Output.ipynb).
TODO: tables? e.g. Pandas DataFrame?
from IPython.display import display, Image, SVG, Math, YouTubeVideo
i = Image(filename='images/notebook_icon.png')
i
display(i)
For some reason this doesn't work with Image(...)
:
SVG(filename='images/python_logo.svg')
Image(url='https://www.python.org/static/img/python-logo-large.png')
Image(url='https://www.python.org/static/img/python-logo-large.png', embed=True)
Image(url='http://jupyter.org/assets/nav_logo.svg')
Image(url='https://www.python.org/static/favicon.ico')
Image(url='http://python.org/images/python-logo.gif')
eq = Math(r"\int_{-\infty}^\infty f(x) \delta(x - x_0) dx = f(x_0)")
eq
display(eq)
%%latex
\begin{equation}
\int_{-\infty}^\infty f(x) \delta(x - x_0) dx = f(x_0)
\end{equation}
YouTubeVideo('iV2ViNJFZC8')
Cells with the cell type "Raw NBConvert" can have different formats. This information is stored in the notebook metadata. To select the format from within Jupyter, switch the cell toolbar to "Raw Cell Format".
Raw cells in "Python" format are not shown at all (nor acted upon in any way).