LaTeX forum ⇒ Theses, Books, Title pagesHow to hyperlink all Bibliography URLs? Topic is solved

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
templateuser
Posts: 679
Joined: Tue Mar 03, 2015 4:01 pm

How to hyperlink all Bibliography URLs?

Postby templateuser » Mon Mar 30, 2015 1:17 pm

First, many thanks to the ones taking care of this website. Really excellent stuff!

I changed the default style to abbrvnat from the template as it fits the requirement better

\bibliographystyle{abbrvnat} % Use the "unsrtnat" BibTeX style for formatting the Bibliography

I want to have all urls in my references list to be hyperlinked say under the word "URL".

I've 100+ urls and some are very long, its not looking very nice. Ideally, a quick solution which results in having all URLs hyperlinked under the word URL..

Please note below example is not really helpful, it will take me ages to do this manually for each entry!

note = {\href{http}{text}}

latexdrivingmecrazy

Tags:

User avatar
Vel
Site Moderator
Posts: 459
Joined: Fri Jun 29, 2012 1:20 am

Postby Vel » Mon Mar 30, 2015 1:17 pm

Hey,

Nice username :) Thanks for the kind words about the website!

This looks like it will solve your problem - though it is not really advisable - you can use the redefinition

  1. \DeclareFieldFormat{url}{\href{#1}{\underline{Link}}}


this definition will print the full URL if hyperref is not enabled

  1. \DeclareFieldFormat{url}{%
  2. \ifhyperref
  3. {\href{#1}{\underline{Link}}}
  4. {\url{#1}}}


Or maybe even - making use of the localisation capabilities biblatex offers

  1. \DefineBibliographyStrings{english}{%
  2. url = {link},
  3. }
  4.  
  5. \DeclareFieldFormat{url}{%
  6. \ifhyperref
  7. {\href{#1}{\bibstring{url}}}
  8. {\url{#1}}}


This was written by moewe at http://tex.stackexchange.com/questions/165656/ but as said it may not be advisable as readers of the physical copy won't be able to follow the URL.

Cheers,
Vel
Founder and administrator of LaTeXTemplates.com and LaTeXTypesetting.com


Return to “Theses, Books, Title pages”

Who is online

Users browsing this forum: No registered users and 3 guests