3
$\begingroup$

Does anyone know a way to add cell numbers (not line numbers within cells)? I have been using nbextensions for a while but it does not seem to have the ability to label cell numbers.

$\endgroup$
3
  • $\begingroup$ do you want to change the cell number for aesthetic reasons? $\endgroup$
    – Leevo
    Commented Jan 22, 2020 at 15:28
  • $\begingroup$ @Leevo I' like to be able to reference a cell, either to a colleague or in the narrative/descriptions. $\endgroup$
    – Matan
    Commented Feb 14, 2020 at 2:55
  • $\begingroup$ This would also be useful for using nbqa to run linters and type checkers that report the cell number $\endgroup$
    – Nev Delap
    Commented Sep 19, 2022 at 3:09

2 Answers 2

1
$\begingroup$

There is a cell tag feature. It allows any kind of label for individual cells, including numbers.

Cell tags are found in the "View" menu, then "Cell Toolbar".

$\endgroup$
0
$\begingroup$

If you need it for a presentation, open the Notebook with a text editor, find the brackets where cell numbers fall and change them manually. If it's something you have to do once.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.