# How to create a Hyperlink within the current Notebook?

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"}]


etc., but nothing works.

-
Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2)Read the FAQs! 3) When you see good Q&A, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign –  István Zachar Nov 5 '12 at 11:08

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".

-
Thanks for your answer! Sorry for such a late thanks. –  Alekh Dec 26 '12 at 18:36
Just one remark. With {EvaluationNotebook[], ...} I get a {NotebookObject[FrontEndObject[LinkObject[...]], 12], target} in the status line when hovering over the "link", while it’s just "target" with the “Create Hyperlink” dialog. –  Alekh Dec 26 '12 at 18:43
@Alekh I guess you have to live with that, as I don't think there is any way to format the status notification of Hyperlink. Unfortunately, a StatusArea` wrapper does not overwrite it. Perhaps it is possible to create a customizable hyperlink using lower level interface elements. –  István Zachar Dec 26 '12 at 21:11