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.

This question already has an answer here:

I have been messing around a bit with different packages - url, hyperref etc. to get urls into my bibliography. Essentially i've got to the point where I have the url - with a clickable weblink over it - which is ~ almost what I want.

However - some of the weblinks are really long - and ugly, and in an ideal world I'd like the link to attach to some other part of the reference in the bibliography - or something that is clearly just a weblink - without the url explicitly shown. I'm pretty sure this should be possible without too much work - I'm sure it is reasonably common in journals.

NOTE - although there are some similar questions to this..... I don't think (????) it's a duplicate.

eg. Is it possible to have URLs link from a pdf to the webpage? - They WANT the url

NOTE: - I'm a relative newbie to bibtex, and will favour solutions that DON'T involve re-writing a bibtex style. As blackadder says "I am one of these people who are quite happy to wear cotton, but have no idea how it works." Hope that doesn't put you off.....

BibTexUrls.tex:

\documentclass[12pt]{article}

\usepackage[numbers,sort&compress]{natbib}
\usepackage{hyperref}

\title{BibTexUrls}
\author{JP}
\date{\today}

\begin{document}
\maketitle

I read something really interesting the other day........\cite{Gaebel2004}

\bibliographystyle{IEEEtran}
\addcontentsline{toc}{chapter}{Bibliography}

\bibliography{BibTexUrls}

\end{document}

BibTexUrls.bib:

@article{Gaebel2004,
author = {Gaebel, T and Popa, I. and Gruber, A. and Domhan, M. and Jelezko, F. and Wrachtrup, J.},
doi = {10.1088/1367-2630/6/1/098},
issn = {1367-2630},
journal = {New Journal of Physics},
pages = {98--98},
title = {{Stable single-photon source in the near infrared}},
url = {http://stacks.iop.org/1367-2630/6/i=1/a=098?key=crossref.c22c6711b1c99f09b470c1b95fb132c0},
volume = {6},
year = {2004}
}
share|improve this question
1  
have you seen tex.stackexchange.com/questions/100782/… ? It sounds like it might be relevant... –  cmhughes Mar 14 '13 at 22:37
1  
tex.stackexchange.com/questions/76174/… is also directly relevant for your problem. –  Corentin Mar 14 '13 at 23:27
    
Thanks for the links - the first is quite good - in terms of it's effect - though not ideal - since it requires editing of the .bib file. The second link is probably the way i should have done it in an ideal world - but I'm afraid I was trying to avoid learning yet another language. I have to say the answer below gets my vote - for simplicity. –  JPH Mar 14 '13 at 23:49
add comment

marked as duplicate by Kurt, Martin Schröder, Speravir, Qrrbrbirlbel, Paul Gaborit Mar 15 '13 at 6:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 4 down vote accepted

If you are willing to modify your bibliography style file, this answer might give what you want (just exchange the DOI link with the URL link). Also, Add a hyperlink in bibtex might help.

But you pointed out that fiddling with bst files is not really an option, and some text that is clearly a link would suffice. This is simple:

\documentclass[12pt]{article}
\usepackage[numbers,sort&compress]{natbib}
\usepackage{hyperref}

\begin{document}
I read something really interesting the other day........\cite{Gaebel2004}

%% add this
\let\oldUrl\url
\renewcommand{\url}[1]{\href{#1}{Link}}
%% up to here

\bibliographystyle{IEEEtran}
\addcontentsline{toc}{chapter}{Bibliography}
\bibliography{BibTexUrls}

\end{document}

You will get the text "Link", that actually links to the URL. sample output

share|improve this answer
    
Boo-yaa! This is exactly what the doctor ordered. Many thanks. –  JPH Mar 14 '13 at 23:46
1  
Minor note of caution - if you have a .bib entry with an empty 'url' field..... it will screw up the subsequent bibliography entry..... Otherwise it is all good. –  JPH Mar 14 '13 at 23:56
add comment

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