Skip to content

Latest commit

 

History

History
119 lines (81 loc) · 3.08 KB

ipynb-slideshow.org

File metadata and controls

119 lines (81 loc) · 3.08 KB

An example ipynb slideshow from org-mode

Custom cell metadata in Jupyter notebooks via org-mode

One feature of Jupyter notebooks that is sometimes used is custom cell metadata. This can, for example be used to put names on a cell, or tags for future analysis or conversion. One of the main uses is for annotating cells as part of a slide show. A cell can be a slide, subslide, fragment, note or skip.

ox-ipynb mostly supports this now. You can add metadata to a heading via properties or paragraphs via an attr_ipynb line or to a code block. The syntax is lispy, basically cons and list cells. These are read by emacs-lisp and converted to json at export time. Here is an example:

for i in range(5):
    print(i)

You can also use it to put a name and list of tags on a markdown cell.

For convenience you can call ox-ipynb-insert-slide to insert the metadata on a paragraph or src-block. It will offer completion on the types of slides you can insert. This is a subslide.

This paragraph is just for notes. It won’t show in the slide show.

No one should probably see this in the slide show.

These features were requested in these issues:

jkitchin#6

jkitchin#11

Export as slide show

There is a new export option ox-ipynb-export-to-ipynb-slides-and-open

Or if you like keybindings

C-c C-e n s.

This was a slide fragment.

You can have equations in your slides

A spiral is a parametric plot in $t$:

$x = cos(t) e-a t$

and

$y = sin(t) e-a t$

You can put in code and figures in your slides

import numpy as np
t = np.linspace(0, 8 * np.pi, 500)
x = np.cos(t) * np.exp(-0.1 * t)
y = np.sin(t) * np.exp(-0.1 * t)

%matplotlib inline
import matplotlib.pyplot as plt
plt.plot(x, y)

obipy-resources/f7bcd5ca21e7c4a20e071bac5ea5bc08-50547ObF.png

Not bad for something quick and easy!

See https://github.com/jkitchin/ox-ipynb.

Probably there are issues. Report them at https://github.com/jkitchin/ox-ipynb/issues