[OS X TeX] OT: hyperref.sty, graphics.sty, pdfTeX and dvips

Bruno Voisin bvoisin at mac.com
Fri Apr 2 18:41:52 EST 2004


Le 3 avr. 04, à 01:22, Ross Moore a écrit :

> Here's how to work around it:
>
>   Firstly, here is an example:
>    \scalebox{2}{\href{http://www.legi.hmg.inpg.fr}{LEGI}}
>   which may not work correctly using pdf-LaTeX.
>
>   \setbox0=\hbox{\scalebox{2}{LEGI}}
>   But this workaround: \href{http://www.legi.hmg.inpg.fr}{\box0}
>   works just fine, and is indeed logically more correct.
>
> The point is that the anchor-text of the \href is the scaled box;
> this is a well-defined concept, and the 2nd example above does it
> right because the scaled box is constructed *before* the \href
> is processed.

Silly me! I realized later today that  
\href{http://www.legi.hmg.inpg.fr}{\scalebox{2}{LEGI}} was more logical  
that \scalebox{2}{\href{http://www.legi.hmg.inpg.fr}{LEGI}} -- see my  
comp.text.tex post which should show up at some point finally -- but it  
was too late...

> If you have a lot of these, then use something like:
>
>    \newcommand{\scalehref}[2][1]{% 2 mandatory + 1 optional arg.
>      % #1 = optional scale-factor, default = 1
>      % #2 = URL to link to
>      % #3 = anchor-text
>      {\setbox0=\hbox{\scalebox{#1}{#3}}\href{#2}{\box0}}}
>
>     
> \newcommand{\LEGIlink}{\scalehref[2]{http:// 
> www.legi.hmg.inpg.fr/}{LEGI}}
>    \newcommand{\TUGlink}{\scalehref[1.5]{http://www.tug.org/}{TUG}}
>    ....

My original problem is unfortunately more tricky, and I really don't  
know what to do apart from switching to dvips. I take a table of which  
one column is made of such hyperlinks  
\url{http://www.legi.hmg.inpg.fr}, and put it in a sidewaystable  
environment. With pdfTeX, the linked area (visualized by the frameboxes  
in Acrobat) does not lie where the table is: the table is rotated in  
both dvips and pdfTeX, the hyperlinks are rotated in dvips but not in  
pdfTeX.

The table goes like this (with many omitted lines):

\begin{sidewaystable}
   \centering\scriptsize
   \begin{tabular}{@{}|c|l|r|l|l|c|@{}}
     \hline
     \textbf{Page} & \multicolumn{1}{c|}{\textbf{URL}} &
       \multicolumn{1}{c|}{\textbf{Serveur}} &
       \multicolumn{1}{c|}{\textbf{Répertoire}} &
       \multicolumn{1}{c|}{\textbf{Alias}} &
       \multicolumn{1}{c|}{\textbf{Webmestre}}
     \tabularnewline\hline\hline
     Laboratoire (VF) &  
\url{http://www.legi.hmg.inpg.fr/legi/index.html} &
       legik260.hmg.inpg.fr & /web/legi/francais/ & /legi/ & weblegi
     \tabularnewline\hline
     Laboratoire (VA) &  
\url{http://www.legi.hmg.inpg.fr/anglais_legi/index.htm} &
       legik260.hmg.inpg.fr & /web/legi/anglais/ & /anglais\_legi/ &  
weblegi
     \tabularnewline\hline
   \end{tabular}
   \caption[Organisation actuelle]{Organisation actuelle du site. }
   \label{tab-etat}
\end{sidewaystable}

Thanks for any lights you may have!

Bruno
-----------------------------------------------------
Please see <http://www.esm.psu.edu/mac-tex/> for list
guidelines, information, and LaTeX/TeX resources.





More information about the MacOSX-TeX mailing list