\label{References}
\renewcommand{\bibname}{References}
\lhead{\emph{References}}
\bibliographystyle{abbrvnat}
\bibliography{Bibliography}
I want to have all urls in my references list to be hyperlinked say under the word "URL". I've 100+ urls and its not looking very nice. I'm using BibTeX; so far, abbrvnat
is the best style that has worked for me.
I'm using a template, hyperref is working fine. (I can hyper jump within the document.)
Any quick solution, i.e. not having to do this manually with each bib entry?
Best Answer
The following solution operates only on the contents of
url
fields. URLs given in other fields are not treated. Since hyperlinking is being performed, thehyperref
package must be loaded.Find the file
abbrvnat.bst
in your TeX distribution. Make a copy of this file, naming the copy (say)myabbrvnat.bst
. (Don't edit directly an original file from your TeX distribution.)Open
myabbrvnat.bst
in a text editor. (The editor you use for your tex files will do fine.)Locate the function
format.url
. In my copy of the file, the function starts on line 306.In this function, replace the line
with
Save the file
myabbrvnat.bst
, either in the directory where your main tex file is located, or in a directory that's searched by BibTeX. If you choose the latter method, be sure to update the filename database of your TeX distribution.Start using the new bibliography style by specifying it as the argument of the
\bibliographystyle
instruction. Be sure to run LaTeX, BibTeX, and LaTeX twice more to propagate all changes.In the pdf file version of the screenshot shown below, the blue "URL" stub is a hyperlink to this question.
The files
main.tex
andmain.bib
that generated this screenshot are as follows:main.tex
main.bib