[OS X TeX] hyperlink to files in samefolder as pdf

Ross Moore ross at ics.mq.edu.au
Wed Jan 18 14:46:18 EST 2006


Hello Gert,

On 19/01/2006, at 2:27 AM, Gert van Oss wrote:

> hi all,
>
> the situation is that I would like to distribute a folder to a  
> group. The content is
> - a pdf file generated by TexShop - LaTeX, and
> - excel files.
>

Try
    \usepackage{attachfile}
then add the Excel files as attachments to the .pdf .

Here is an example of how I use it to attach metadata
(in HTML) to the cover-page of PDFs of journal articles:

\edef\filerss{\ArticleDirectory/\ArticleNumber-e.rss}%
\IfFileExists{\filerss}{%
\textattachfile[color=.5 0 1%
, author={\JournalShortName, Vol \Volume, No \Number}%
, date= \Month\space\Year %
, mimetype= application/html %
, icon= Pin %
, description={HTML for RSS feed.}%
]{\filerss}{(RSS feed)}}{}
             ^^^^^^^^^^ ------  visible text

The \text... part of the command refers to have a textual link
in the parent PDF, as well as an icon button (here a 'Pin').
Using  \attachfile , instead of \textattachfile , there is one
less argument --- omitting this textual link.


Your colleagues may need to use Adobe Reader to access the attachments,
since Preview is not up to it.



> For the pdf file I will use
> \usepackage[colorlinks=true, pdfstartview=FitV, linkcolor=blue,  
> citecolor=blue, urlcolor=blue]{hyperref}
>
> so that I can generate a hyperlink to the excel files in the  
> distributed folder.

If you don't want to use attachments ...

>
> I can't seem to set up a 'local-hyperlink'. Does anyone know if  
> this is possible at all?
>
> Something like:
>
> \href{/Users/gertmt/Documents/Opleidingen/Voorstel/Rapport/ 
> VersieTextMate12/excels/test.xls}{This works}
>
> works but
>
> \href{excels/test.xls}{this doesn't work....}
>
> is not successful.

Did you try   \href{./excels/test.xls}{....}  ?
Or    \href{file:./excels/test.xls}{....}     ?

Or there is the \hyperbaseurl  command;
e.g.
   \hyperbaseurl{/Users/gertmt/Documents/Opleidingen/Voorstel/Rapport/ 
VersieTextMate12}

    \href{excels/test.xls}{this may work....}

... provided your colleagues are on the same file system, and have
local access to your files.

Maybe it should be:
   \hyperbaseurl{file:/Users/gertmt/Documents/Opleidingen/Voorstel/ 
Rapport/VersieTextMate12}

But this method may upset other URLs that you have in the PDF.
Try it and see.



Alternatively, make the files available on the web and have your
colleagues download them from there, using  http://  addresses.


>
> Maybe someone can tell me what I'm doing wrong?

There are several alternatives.

The attachments are probably the most flexible, as you keep the
whole bundle together in one PDF. This allows access even when
not connected to the web, or to your own machine.
  e.g. put the PDF on a USB stick for the transfer to a laptop.



>
> Regards,
>
> Gert

Hope this helps,

	Ross

> ------------------------- Info --------------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>          & FAQ: http://latex.yauh.de/faq/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Archive: http://tug.org/pipermail/macostex-archives/
>

------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114
------------------------------------------------------------------------


------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the MacOSX-TeX mailing list