Message Boards Message Boards

0
|
8331 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

What's the easiest way to hyperlink text?

Here’s one way to create a text cell hyperlink that can be easily merged with other text cells:

CellPrint[
   Cell[
      TextData[{ButtonBox["Example Domain", BaseStyle -> "Hyperlink",
         ButtonData -> {URL["http://example.com"], None}] } ],
      "Text"] ]
2 Replies

Thanks for the link to your StackExchange post, which gives this recipe:

Inside a text cell start an inline cell: Insert > Typesetting > Start Inline Cell, enter hyperlink:

Hyperlink["Example Domain", "http://example.com"]

select entered hyperlink and evaluate: Evaluation > Evaluate in Place.

Your method has the advantages of simplicity and dynamic mouseover color change, the method I propose is a bit more complicated and lacks the mouseover, but has the advantage of creating essentially the same ButtonBox structure as Insert > Hyperlink...

6/30/16 update:

Originally, this reply reported that either method was a suitable workaround for a hypothetical Mathematica prerelease bug. In fact, the latest update has eliminated the need for such workarounds, because Insert > Hyperlink... now works correctly.

You can Evaluate in Place content of inline cell too. (if that's the question)

POSTED BY: Kuba Podkalicki
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract