Using “Create Hyperlink” dialog window I can create a link to a tagged cell in my notebook (it's “Destination notebook: Current notebook” radio button).
Now, I can't figure it out how to create such links with Hyperlink[] command.
I tried
Hyperlink["label", {"", "tag"}]
Hyperlink["label", {None, "tag"}]
Hyperlink["label", {Automatic, "tag"}]
etc., but nothing works.
Answer
You have to use EvaluationNotebook[] to point to the actual notebook you are working in (you don't even have to save it). First, create a cell with a tag:
CellPrint@Cell["Target cell", "Text", CellTags -> {"target"}]
and then create the link that points to the target cell:
Hyperlink["link", {EvaluationNotebook[], "target"}]
Clicking the link will select the cell with tag "target".
Comments
Post a Comment