[pdftex] different behaviour of baseurl with \href in pdfTeX and dvipdfm

Jan Schween jan.schween at lrz.uni-muenchen.de
Tue Sep 26 19:36:14 CEST 2006


hello,

I have the following problem with \href in pdfTeX:

I try to reference a file from my PDF-document which lies in a sub-directory 
relative to the PDF. I would like this link to work independently whether the 
files are on my local machine or lie on an internet server. (Actually i am 
submitting a scientific paper to an online journal and i dont know the place 
where they will place my PDF - the idea is to tell the reader that they can 
read it online or download the files and read and see everything on their local 
machine).

To achieve this i place a 'baseurl' option when loading the hyperref package:

\usepackage[ pdftex , baseurl=./ ]{hyperref}

the reference in the text below is then:

\href{movies/map.m1v}      % link to movie
     {movie {\tt map.m1v}.} % text to appear

The idea is that the baseurl './' is expanded into the actual path where the 
pdf-document is located. 

This works fine with  dvipdfm-0.13.2c 
(if i switch off the pdftex option for hyperref package)

But it does NOT work with  pdfTeX-1.21a.

The examples A1 and A2 on 
http://www.meteo.physik.uni-muenchen.de/~hase/banner/texte/movie_example/
show the results. Look at the links in the caption of figure 1.

A1 was created with dvipdfm: 
The link is expanded into 'http://www.../movies/map.m1v'
If you download the pdf to your local machine and open it the link will be 
expanded into 'file:///<localdir>/movies/map.m1v'
(at least this happens on my windows machine an on some Linux machines) 

A2 was created with pdfTeX: 
The link is expanded into 'movies/map.m1v' and does not work.
If you download the pdf to your local machine and open it, the link will be 
expanded into 'movies/map.m1v'
Accordingly the baseurl=./ is ignored.
Ommitting the baseurl option produces a link 'file:movies/map.m1v' 
independent of where the file is downloaded. 



Is this 
(1) a very intelligent solution in  dvipdfm or 
(2) a dirty workaround in  dvipdfm or 
(3) a bug of pdfTeX ?

... or is there another way to do this in pdfTeX ?.


many thanks in advance

- Jan Schween -

--------------------------------------------------------------------
  Dr. Jan H. Schween
  Meteorologisches Institut der Universität München
  Theresienstr. 37
D-80333 Munich
Germany
phone: +49.(0)89.2180.4635
fax:   +49.(0)89.2180.4381
mail: jan.schween at lrz.uni-muenchen.de
--------------------------------------------------------------------



More information about the pdftex mailing list