# How to make biblatex/biber aware of \url field in @Phdthesis?

I have used instructions on biblatex: make title hyperlink to DOIs, URL or ISBN to hyperlink titles of my references to their respective url or doi entries. However, it does not work for @PhdThesis or @thesis, perhaps because url is not even an optional field for this document type in BibTeX. However, it is an optional field for @thesis in biblatex, see p. 12 in http://www.texdoc.net/texmf-dist/doc/latex/biblatex/biblatex.pdf. Is there any easy way to make it work?

• Welcome to TeX.SE! As usual here please add an compilable short tex code showing how you build your bibliography! please do not forget to add two bib entries to your question ... – Mensch Jan 23 '19 at 8:15
• What biblatex style do you use? Whether a given field is used depends on the style. It should be an easy fix, but we need to know the style. – Paul Stanley Jan 23 '19 at 8:44

The linked answer to biblatex: make title hyperlink to DOIs, URL or ISBN does indeed not set up links for all entry types. Due to the type-specific formats in biblatex, the

\DeclareFieldFormat{title}{\usebibmacro{string+doiurlisbn}{\mkbibemph{#1}}}
\DeclareFieldFormat[article,incollection]{title}%
{\usebibmacro{string+doiurlisbn}{\mkbibquote{#1}}}


used there does not change the definitions of inbook and thesis (amongst others). With

\DeclareFieldFormat{title}{%
\usebibmacro{string+doiurlisbn}{\mkbibemph{#1}}}
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{title}{\usebibmacro{string+doiurlisbn}{\mkbibquote{#1\isdot}}}
\DeclareFieldFormat
[suppbook,suppcollection,suppperiodical]
{title}{\usebibmacro{string+doiurlisbn}{#1}}


we make sure to link all titles. This is a complete copy of the standard definitions of the title field format with \usebibmacro{string+doiurlisbn} sprinkled in. See Remove Quotation Marks from Style for more info on the type-specific formatting and how to modify them properly.

In full

\documentclass{article}

\usepackage[doi=false,url=false,isbn=false]{biblatex}

\newbibmacro{string+doiurlisbn}[1]{%
\iffieldundef{doi}{%
\iffieldundef{url}{%
\iffieldundef{isbn}{%
\iffieldundef{issn}{%
#1%
}{%
}%
}{%
}%
}{%
\href{\thefield{url}}{#1}%
}%
}{%
\href{http://dx.doi.org/\thefield{doi}}{#1}%
}%
}

\DeclareFieldFormat{title}{%
\usebibmacro{string+doiurlisbn}{\mkbibemph{#1}}}
\DeclareFieldFormat
[article,inbook,incollection,inproceedings,patent,thesis,unpublished]
{title}{\usebibmacro{string+doiurlisbn}{\mkbibquote{#1\isdot}}}
\DeclareFieldFormat
[suppbook,suppcollection,suppperiodical]
{title}{\usebibmacro{string+doiurlisbn}{#1}}

\begin{filecontents}{\jobname.bib}
@phdthesis{elk,
author      = {Anne Elk},
year        = {1972},
title       = {A Theory on Brontosauruses},
url         = {https://example.edu/~elk/bronto.pdf},
institution = {Monty University},
}
\end{filecontents}


• Thank you, this did it! I thought I had tried adding thesis to \DeclareFieldFormat[article,incollection] but did not see an effect. Using your code above works. – Stan Schymanski Jan 24 '19 at 13:44