How to |
Insert a Hyperlink
includes rich support for linking between notebooks and from notebooks to websites. You can simply add references to a single notebook or link between a series of interrelated documents.
Creating links in Mathematica
is done with Hyperlink
, which outputs a link to the argument you give it.
For example, using a URL with Hyperlink
creates a link to that URL:
accepts any standard URI (Uniform Resource Identifier), including properly encoded http:, ftp:, and mailto: URIs. Clicking the resulting link opens your web browser or default handler for that link type.
also accepts a path to a notebook file or a file: URI. Clicking that link opens the file in Mathematica
If the target notebook file uses cell tags, which are typically used to allow searching for cells, you can link directly to a particular cell by specifying the tag along with the path.
refers to a cell tag:
By specifying a paclet: URI with Hyperlink
, you can also create links to Mathematica
's own help system. The string that follows
is typically shown in the Documentation Center's search field for a given page.
Here, a link to the documentation page for Hyperlink
Opening the documentation page for Hyperlink
, you can see that the string following
appears in the Documentation Center's search field:
If you do not want the exact text of the link itself to be visible, Hyperlink
takes an optional first argument that lets you use a different label.
This label can be any expression, including a graphic:
You can even create a link on just a piece of a graphic by using Hyperlink
, with a graphics primitive as the label.
Here, only the purple disk is a hyperlink:
The links created by Hyperlink
must be clicked to visit the linked URI. However, you can use SystemOpen
to automatically visit the linked URI without having to click anything.
supports the same URIs as Hyperlink
In addition to opening websites and notebook files, SystemOpen
can also open any other kind of file as long as you have the corresponding application installed.
will open the file with the same application your operating system uses to open the file by default:
Links can also be created interactively. That is, you do not have to use Hyperlink
to create them.
For example, select some text or graphics in your notebook that you would like to turn into a link. Then choose from the menu.
A dialog for inserting links appears:
, you can use this dialog to link to any valid URI.
To link to a website, type the full address into the text field at the top and click OK
to create the link.
To link to another notebook file, click the Browse
button and then locate the notebook file using your operating system's file browser. If that notebook has cell tags, you can then select one from the field at the bottom to link directly to a particular cell.