Skip to content

Instantly share code, notes, and snippets.

@anghyflawn
Created April 29, 2015 13:29
Show Gist options
  • Save anghyflawn/cd207857ca4306eea0a6 to your computer and use it in GitHub Desktop.
Save anghyflawn/cd207857ca4306eea0a6 to your computer and use it in GitHub Desktop.
Link to DOI in title
% The biblatex-sp-unified style is at http://github.com/semprag/biblatex-sp-unified
\usepackage[backend=biber,
bibstyle=biblatex-sp-unified,
citestyle=sp-authoryear-comp,
mincrossrefs=50,
maxcitenames=3,
maxbibnames=50,
doi=false]{biblatex}
\newbibmacro{string+doi+emph}[1]{%
\iffieldundef{doi}{\mkbibemph{#1}}{\href{http://dx.doi.org/\thefield{doi}}{\mkbibemph{#1}}}}
\newbibmacro{string+doi}[1]{%
\iffieldundef{doi}{#1}{\href{http://dx.doi.org/\thefield{doi}}{#1}}}
\DeclareFieldFormat*{title}{\usebibmacro{string+doi}{#1}}
\DeclareFieldFormat*[book,collection,thesis,unpublished]{title}{\usebibmacro{string+doi+emph}{#1}}
\DeclareFieldFormat*[book,collection,,thesis,unpublished]{subtitle}{\usebibmacro{string+doi+emph}{#1}}
\DeclareFieldFormat*{booktitle}{\usebibmacro{string+doi+emph}{#1}}
\DeclareFieldFormat*{booksubtitle}{\usebibmacro{string+doi+emph}{#1}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment