TLDR: Maybe you can use tags with Button["interesting tag",NotebookLocate["interesting tag"]]
in text cells or (* NotebookLocate["interesting tag"] *)
with in-place evaluation (Ctrl+Shift+Enter) in input cells. In a cloud notebook, you might have to use CellPrint
with the CellTags
option as I did not find a menu item for tags.
Usual Mathematica notebook (not the cloud notebook)
In the usual Mathematica notebook (not the cloud notebook) you can add a tag to a cell by right-clicking the cell and adding a tag. For example, you can add a tag called "interesting tag". Then you can use Button["interesting tag",NotebookLocate["interesting tag"]]
to jump to that tag if the button is in an output cell or text cell.
If you would like to add the "link" in an input cell with an expression that will be evaluated like s=4+j
, then instead of a button you can use a comment (* NotebookLocate["interesting tag"] *)
and use in-place evaluation with Ctrl+Shift+Enter to evaluate only NotebookLocate["interesting tag"]
. This method has the advantage that you can return back the previous cell using Ctrl+F for search and find and then search for that piece of code. One could also add a tag to the previous cell where the user "teleported from".
The cloud notebook
On the cloud notebook, I did not find a menu option for tags but it seems tags still work using CellPrint
with the CellTags
option. For example:
CellPrint[TextCell["abcd", "Text", CellTags -> "tag"]]
then I checked that NotebookLocate["tag"]
seems to jump to the location of the tag placing the tag at the top of the screen without selecting the tag (unlike in the usual non-cloud notebook). This seems to work for two tags as well so I imagine that this works for any number of tags.
NotebookLocate
$\endgroup$