MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: hyperlink to pdf files

  • To: mathgroup at
  • Subject: [mg45664] Re: [mg45565] Re: hyperlink to pdf files
  • From: Christopher Purcell <christopherpurcell at>
  • Date: Sat, 17 Jan 2004 02:34:33 -0500 (EST)
  • References: <bu0dkd$amu$> <> <> <>
  • Sender: owner-wri-mathgroup at

Thank you Roland, with your clues I found my finger trouble, and some  
differences from your example.

Here is my working hyperlink under Mac OS X that solves my requirement  
perfectly - launching Adobe Acrobat or Apple Preview on a pdf file  
directly from the help browser.

Cell[TextData[ButtonBox["Examples Manual",
       StringJoin[ "file://",
         ToFileName[ {$AddOnsDirectory, "Applications", "MyPackage",  
"Documentation", "English",
           "References"}, "examples.pdf"]]], None},
   ButtonStyle->"Hyperlink"]], "Input"]

Under OS X only 2 slashes are used after "file://" and in the  
ToFileName, the curly brackets must include only the directory list and  
not the file name. Under OS X there is no environment variable  
"userprofile" but I don't need it anyway.
  With OS X working I will now turn to Windows and see if the same rules  
apply - and if platform independence is really possible without yucky  
If [$OperatingSystem==, ] structures all over the place.

Christopher Purcell
Sensors & Actuators Group
DRDC-Atlantic, 9 Grove St., PO Box 1012,
Dartmouth NS B2Y 3Z7 Canada
Tel 902-426-3100 x389
Fax 902-426-9654
On Jan 16, 2004, at 1:21 PM, Roland Franzius wrote:

> On the question how to create platform independent and environment  
> dependent hyperlinks.
> Since I have no Linux System runnig Mathematica these hours perhaps this will  
> take you a step further:
> Cell[TextData[ButtonBox["Relativistische Quantenmechanik",
>  ButtonEvaluator->Automatic,
>  ButtonData:>{
>    URL[
> StringJoin["file:// 
> /",ToFileName[{Environment["userprofile"],"Desktop","RelQm01.pdf"}]]],  
> None},
>  Active->True,
>  ButtonStyle->"Hyperlink"]], "Input"]
> ToFileName[]  without a wrapping List is considered  to be an error by  
> the Show  Expression translator button. I have added
> ToFileName[{ path,...,file }] and a third / in "file:///"
> -- 
> Roland Franzius

  • Prev by Date: RE: Pipes Inside Mathematica?
  • Next by Date: Re: Script, Gothic and DoubleStruck Characters
  • Previous by thread: Re: Re: hyperlink to pdf files
  • Next by thread: List arguments to functions