Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using biblatex with the href option for my bibliography.

I would like to use the url field of my bib file to add a hyperlink to the online version of the article. However I don't want the whole url link to be printed in the bibliography but, if that's possible the link to appear when clicking on the volume / page of the cited journal (or on the journal name would also be fine) - as it is the case in a lot of scientific journals.

I am using the nature citation style and have tried to modify the .bbx according to my needs - but my knowledge of the .bbx structure and LaTeX macros is very sparse.

share|improve this question
1  
You should have a look at this post –  Corentin Dec 11 '12 at 21:25
    
@verao I'm not a user of biblatex, but have you checked 3.11.7 Elctronic Publishing Information, p. 127, of its user manual? You may find suitable solutions there. –  nnunes Dec 12 '12 at 1:30
add comment

1 Answer 1

The way the nature style is setup it is easiest to replace the pages with the link (or the volume) but getting the pages and volume is difficult since they are printed at different times. You would have to do a major overhaul of the style. The meat of the solution is

\newbibmacro*{myurl}{\printfield[myurl]{url}}
\DeclareFieldFormat{myurl}{\href{#1}{\printfield{pages}}}

\newbibmacro*{note+pages}{%
  \printfield{note}%
  \setunit{\bibpagespunct}%
  \usebibmacro{myurl}%
  \newunit}

combining it to form a complete MWE gives:

\documentclass{article}
\usepackage{filecontents}
\usepackage[style=nature, url=true]{biblatex}
\usepackage{hyperref}
\begin{filecontents}{\jobname.bib}
@article{aksin,
  author = {Aks{\i}n, {\"O}zge and T{\"u}rkmen, Hayati and Artok, Levent
    and {\k{C}}etinkaya, Bekir and Ni, Chaoying
    and B{\"u}y{\"u}kg{\"u}ng{\"o}r, Orhan and {\"O}zkal, Erhan},
  indextitle = {Effect of immobilization on catalytic characteristics},
  title = {Effect of immobilization on catalytic characteristics of saturated
    Pd-N-heterocyclic carbenes in Mizoroki-Heck reactions},
  journaltitle = jomch,
  volume = {691},
  number = {13},
  date = {2006},
  pages = {3027--3036},
  url = {http://www.google.com}
}
\end{filecontents}
\addbibresource{\jobname.bib}

\newbibmacro*{myurl}{\printfield[myurl]{url}}
\DeclareFieldFormat{myurl}{\href{#1}{\printfield{pages}}}

\newbibmacro*{note+pages}{%
  \printfield{note}%
  \setunit{\bibpagespunct}%
  \usebibmacro{myurl}%
  \newunit}

\begin{document}
\cite{aksin}
\printbibliography
\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.