Hi List,

How do you make a hyperlink for a bibtex entry's title using the entry's URL?

The bibtex entries include articles, techreports, inproceedings,
books, and so forth. I can work around the issue by duplicating the
URL as follows. For example, save this as "sources.bib":

@inproceedings{schryen@security,
  author={Schryen, Guido and Rich, Eliot},
  title={\bibhref{Increasing software security through open source or
closed source development? Empirics suggest that we have asked the
wrong question}{http://epub.uni-regensburg.de/21293/}},
  booktitle={Proceedings of the 2010 43rd Hawaii International
Conference on System Sciences},
  series={HICSS '10},
  year={2010},
  isbn={978-0-7695-3869-3},
  pages={1--10},
  numpages={10},
  doi={10.1109/HICSS.2010.228},
  acmid={1748219},
  publisher={IEEE Computer Society},
  address={Washington, DC, USA},
  url={http://epub.uni-regensburg.de/21293/},
}

Here is a short example that uses the sources.bib file:

\setupbibtex[database=sources]
\setuppublications[
  alternative=num,
  sorttype=cite,
]

% Superscript citation cross-references.
\setupcite[num][
  left=\raisebox{1ex}\hbox\bgroup\tfxx,
  right=\egroup,
]

\definecolor[WPexternal][h=B93507]

\setupinteraction[
  state=start,
]

\def\WPHyperlink{%
  \setupinteraction[
    style=normal,
    color=WPexternal,
  ]%
}

\define[2]\bibhref{%
  \WPHyperlink
  {\goto{#1}[url(#2)]}%
}

\starttext
  \startbodymatter
    \startchapter[title={Title},]
      \startsection[title={Transparency}]
        The complete source code is open for analysis and
        development.\cite[schryen@security]
      \stopsection
    \stopchapter
  \stopbodymatter
  \startbackmatter
    \completepublications[criterium=text]
  \stopbackmatter
\stoptext

The title is hyperlinked, but mixes presentation with content and
duplicates the URL. Note that the colour is also changed to match the
other external links in the document.

Thank you.
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to