1 | initial version |
As far as I can tell, there is no way to do this "cleanly" under program control : a notebook is not a way to program a system. However, there are a few things possible, at least in Jupyter notebooks (the old Sage notebook is unmaintained, unmaintainable and will die sooner or later : don't start new work with it, unless you need some specific feature such as multi-user access) :
* Go to a cell, and request evaluation of all cells above.
* Introduce a cell raising a runtime error (e.g. a syntax error, referencing an undefined variable, division by 0, und so weiter...)..
* Write a program. Notebook is a great way to jot down and test ideas quickly, not to polish up a paper.
For the latter, \LaTeX and Sagetex (or Pythontex (or org-babel)) are much more easy...