Message Boards Message Boards

0
|
6826 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Problems with 'Hyperlink["label",("notebook.nb"',"celltag"}]

Posted 9 years ago

Hi,

I am facing the following problem

(* The following sometimes works but sometimes does not *)

(* The issue has been tested in many occasions and situations *)

(* The format does not even launch the linked notebook *)

Hyperlink["label", {"notebook.nb", "celltag"}]

(* However the following always work *)

Hyperlink["label", "notebook.nb"]

(* Both formats have been tested many times in the same situations and conditions *)

Any help will be wellcome.

Martin.

POSTED BY: E Martin
4 Replies
Posted 9 years ago

I will be a bit more specific`

(* Both formats set in individual or separated cells wok *)

Hyperlink["GraphicsObjectLabel", {"notebook.nb", "celltag"}]

Hyperlink["GraphicsObjectLabel", "notebook.nb"]

(* But if set inside a compund construct as in a module *)

Module[{},
 (* some executable code *)
 (* this does not work *)
 Hyperlink["GraphicsObjectLabel", {"notebook.nb", "celltag"}];
 (* some executable code *)
 (* this does work *)
 Hyperlink["GraphicsObjectLabel", "notebook.nb"]
 ]

Martin

POSTED BY: E Martin
Posted 9 years ago

Hi Martin,

Hyperlink[<...>]; does not produce a hyperlink simply because you have suppressed the output from this piece of code by adding the ";" at the end. Please read the Documentation for CompoundExpression (;) and try the following:

Module[{hyperlink1, hyperlink2},
 (* some executable code *)
 (* first hyperlink *)
 hyperlink1 = Hyperlink["GraphicsObjectLabel", {"notebook.nb", "celltag"}];
 (* some executable code *)
 (* second hyperlink *)
 hyperlink2 = Hyperlink["GraphicsObjectLabel", "notebook.nb"];
 (* the output *)
 Column[{hyperlink1, hyperlink2}]
 ]
POSTED BY: Alexey Popkov
Posted 9 years ago

Many thanks Alexey,

You are right in respect to the ";" at the end of the sentences. Unfortunately, I did not make the question correctly. Your code is somewhat equivalent to

Module[{}, {Hyperlink[
   "GraphicsObjectLabel", {"notebook.nb", "celltag"}],
  Hyperlink["GraphicsObjectLabel", "notebook.nb"]}] 

This time without the offending ";".

But I do not need a column of hyperlinks. The actual problem has nothing to do with ",", it results from the pieces of (* some executable code *) within the module to proper positioning the hyperlinks. This would not be neccesary if the current implementaion of multiple edges graphs worked as expected

ref/Graph

In fact the labels named as "GraphicsObjectLabel" in the hyperlinks are edges of a graph (see the graph below), where the hyperlinks are connections to other notebooks with the explanation of the flows represented by the edges. The whole code for the graph is pretty tricky and cannot be posted, since the current implementation of Matematica does not truly support multiple edges among vertices the actual code is a workaround to circumvent the problem already mentioned in other posts about the current multiple edges graph bug.

The multiple edge graph shown below relays on a primitive (function) programmed by David Park, which overcomes the bug and allows for refinning interactively the layout of the edges in a graph, at will.

enter image description here

Anyway, I haven’t solved yet the

Hyperlink["GraphicsObjectLabel", {"notebook.nb", "celltag"}]

issue; while

Hyperlink["GraphicsObjectLabel", "notebook.nb"]

works OK.

Again, any help will be welcomed.

Martin.

POSTED BY: E Martin
Posted 9 years ago

Hi,

Back again with the Hyperlink/tags issue.

The following taken directly form the Help browser `about 'Hyperlink', makes clearer the difficulty I posted.

The following code to check the issue id provided in the two notebooks I am attaching

Hyperlink["Hyperlink/see 'details and options'", \
"paclet:ref/Hyperlink"]

Plot[{Hyperlink[Sin[x], "http://mathworld.wolfram.com/Sine.html"], 
  Hyperlink[Cos[x], "http://mathworld.wolfram.com/Cosine.html"]}, {x, 
  0, 2 Pi}]

SinCosTagsFile = FileNameJoin[{NotebookDirectory[], "SinCosTags.nb"}];

Plot[{Hyperlink[Sin[x], {SinCosTagsFile, "Tag02"}], 
  Hyperlink[Cos[x], SinCosTagsFile ]}, {x, 0, 2 Pi}, 
 PlotLegends -> "Expressions"]

Please, run the notebook 'TestingHyperlinkTags.nb', click alternatively on the plots of Sin[x] and Cos[x], they act as hyperlinks. From the Wolfram documentation I understand that both clickings should launch the notebook 'SinCosTgs.nb'. The 'Sin' hyperlink should access directly the given tag ("Tag02") within the launched notebook, the ‘Cos’ hyperlink should access directly the first cell tagged as “Tag01”.

Try and check how it responds.

Recall that my example is a slight and trivial modification of the example given in the Wolfram documentation.

What am I missing here?

Martin.

Attachments:
POSTED BY: E Martin
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