[OS X TeX] \cite within \href

Ross Moore ross at ics.mq.edu.au
Wed Jan 25 18:56:08 EST 2006


Hi Alan,

On 26/01/2006, at 10:42 AM, Alan Munn wrote:

> Hi,
>
> I would like to include external hyperlinks to documents on a  
> reading list generated by BiBTeX.
>
> I thought that the logical thing to do would be the following:
>
> \href{link-to-paper}{\cite{cite-key-of-paper}}

Nice try ...

>
> But this doesn't seem to work.  I get a link, but it is just to the  
> place where the bibliography is.  So hyperref seems to be ignoring  
> the first part of the href.

  ... but you actually get 2 links, at exactly the same place.

Due to the order of the internal expansions and processing,
the \href link button (technically called an 'annotation')
is placed first. The \cite link button comes afterwards.
But since the anchor-text is exactly the same in both cases,
the active rectangle of the 2nd totally obscures the first.

Thus you get what you described.
It is quite correct behaviour.

>
> Am I doing something wrong?

You need to find a better way to organise your LaTeX source;
e.g.

  ... read about it in \href{link-to-paper}{Watson \cite{cite-key-of- 
paper}}.


(where the paper is by someone named Watson).

Now the 'Watson' will be active for the external URL,
while the citation number will take you to the Bibliography.


Alternatively, suppose the \cite command was producing:  Watson [1]

Then define the \bibitem entry so that it produces instead:

      \href{link-to-paper}{Watson} [1]

Now you simply use  \cite{cite-key-of-paper}  as usual in you LaTeX  
document,
and you should get both links.
Now the \href will obscure only part of the active rectangle for the  
\cite .


>
> Thanks

Hope this helps,

	Ross

>
> Alan
>
> -- 
> Alan Munn                                                    
> amunn at msu.edu
> Department of Linguistics                                    
> amunn at acm.org
> and Germanic, Slavic, Asian and African Languages   Fax.   
> +1-517-432-2736
> Michigan State University, East Lansing MI 48824    Tel.   
> +1-517-355-7491
> ------------------------- 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