[IPython-dev] Renumber cells for nbconvert

Cyrille Rossant cyrille.rossant at gmail.com
Fri Sep 19 15:18:10 EDT 2014


FYI here is a simple JS extension that linearly renumber all cells in
the notebook:

http://nbviewer.ipython.org/github/ipython-books/cookbook-code/blob/master/notebooks/chapter03_notebook/03_controls.ipynb

2014-09-18 23:10 GMT+02:00 Jon Wilson <jsw at fnal.gov>:
> Hi,
> We often share around nbconverted notebooks in my research group. But,
> it is difficult to refer (when in a phone meeting) to specific figures
> or pieces of code or other output in the notebook.  This is because the
> cells are often executed out of order, so they have non-sequential numbers.
>
> Now, in some situations, knowing the order of execution is crucial.
> But usually in this case, the order is unimportant.  The non-sequential
> ordering is due to things like "oh, I made a mistake in the fifth
> figure, let me try a few things to fix it, now the 4th figure needs to
> be fixed too," etc.
>
> So, if it were possible to re-number the cells, either in the notebook
> proper or in the nbconvert step, that would make our lives a little bit
> easier.
>
> Alternatively, it would be pretty awesome if figures could have
> automatic (sequential) figure numbering.  Then the cell numbering
> wouldn't matter nearly as much.
> Regards,
> Jon
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev



More information about the IPython-dev mailing list