TransWikia.com

How can I remove clickable hyperlinks in references while keeping all other hyperlinks in my document?

TeX - LaTeX Asked by jo_elk on April 26, 2021

I want to use hyperref in order to create hyperlinks so I can, say, click on a reference to an equation and jump to that equation, or to click on a citation in the text and jump to that reference in the bibliography.

However, I DO NOT want the references in the bibliography themselves to be "clickable", meaning they link to an external website containing the original reference.

I am using

documentclass{report}
usepackage[hidelinks]{hyperref}
usepackage[backend=biber, style=phys, biblabel=brackets, sorting=nyt, 
doi=false, isbn=false, url=false]{biblatex}

Including hyperref=false in biblatex removes the clickable hyperlinks in the references, however also the hyperlinks from the text TO the references, which I want to keep.

The only solution I have found is manually commenting both doi and url in my .bib file, which is tedious.

One Answer

biblatex-phys links parts of the bibliography entry using the doi/url-link field format.

If you don't want that you can just redefine the field format to do nothing with

DeclareFieldFormat{doi/url-link}{#1}

MWE

documentclass[british]{article}
usepackage[T1]{fontenc}
usepackage{babel}
usepackage{csquotes}

usepackage[backend=biber, style=phys, biblabel=brackets, sorting=nyt, 
doi=false, isbn=false, url=false]{biblatex}
usepackage{hyperref}

DeclareFieldFormat{doi/url-link}{#1}

addbibresource{biblatex-examples.bib}

begin{document}
Lorem autocite{sigfridsson}

printbibliography
end{document}

Entry without link.


Alternatively, you can get a bit more aggressive about removing url and doi by using a Biber sourcemap.

documentclass[british]{article}
usepackage[T1]{fontenc}
usepackage{babel}
usepackage{csquotes}

usepackage[backend=biber, style=phys, biblabel=brackets, sorting=nyt]{biblatex}
usepackage{hyperref}

DeclareSourcemap{
  maps{
    map{
      step[fieldset=isbn, null]
    }
    map{
      pernottype{online}
      step[fieldset=doi, null]
      step[fieldset=eprint, null]
      step[fieldset=url, null]
      step[fieldset=urldate, null]
    }
  }
}

addbibresource{biblatex-examples.bib}

begin{document}
Lorem autocite{sigfridsson}

printbibliography
end{document}

Correct answer by moewe on April 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP