0

This is a follow up question to biblatex: Make title hyperlink to doi url (if available) and biblatex: make title hyperlink to DOIs, URL or ISBN!

First , I have an issue with breaklinks=true because the urls don't break up and I have to turn breaklinks on but at the same time , if I turn on it, these links are no longer be clickable. breaklinks=false Here is the code from Herbert.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber]{biblatex} 
\usepackage[colorlinks,breaklinks=false]{hyperref}
\bibliography{biblatex-examples}
\ExecuteBibliographyOptions{doi=false}
\newbibmacro{string+doi}[1]{%
  \iffieldundef{doi}{#1}{\href{http://dx.doi.org/\thefield{doi}}{#1}}}
\DeclareFieldFormat{title}{\usebibmacro{string+doi}{\mkbibemph{#1}}}
\DeclareFieldFormat[article]{title}{\usebibmacro{string+doi}{\mkbibquote{#1}}}
\begin{document}
A reference to~\cite{kastenholz} and~\cite{sigfridsson}. 
\printbibliography
\end{document}

Second, I would like to know how I can change this to "authors" instead of "title". Thanks for your help.

1

So finally I ended up putting all other people's work together. (1,2,3,4).Hope I included everyone. Here is the combined code.

\documentclass[12pt]{article}
\usepackage[dvips]{graphicx}
\usepackage{epstopdf} 

\usepackage[pdftex,colorlinks]{hyperref}

\usepackage[backend=biber]{biblatex} 


\bibliography{biblatex-examples}
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%This part in in bbx file.

\ExecuteBibliographyOptions{doi=false}
\DeclareFieldFormat{doilink}{%
    \iffieldundef{doi}{%
    \iffieldundef{url}{%
     #1%
    }{%
      \href{\thefield{url}}{#1}%
    }%
  }{
   \href{http://dx.doi.org/\thefield{doi}}{#1}
   }%
}


\DeclareBibliographyDriver{article}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
   \printtext[doilink]{%
  \usebibmacro{author/translator+others}%
  }%
  \setunit{\labelnamepunct}\newblock%
  \addperiod%
  \usebibmacro{title}%
  \addperiod%
  \newunit\newblock%
  \usebibmacro{journal+issuetitle}%
  \newunit\newblock%
  \iftoggle{bbx:isbn}%
    {\printfield{issn}}%
    {}%
  \newunit\newblock%
  \addperiod%
  \usebibmacro{doi+eprint+url}%
  \usebibmacro{pageref}%
  \usebibmacro{finentry}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\cite{kastenholz}\qquad\cite{herrmann}\qquad\cite{sigfridsson}
\printbibliography
\end{document}

Here is the screen shot. Enjoy. This one going to pick DOI first and if DOI is not available , it would find url. Thanks everyone!  screenshot

0

To use breaklinks=true in hyperref, use pdftex. For example in Texshop, I was able to run in Alternative Typesetting Mode.

%!TEX TS-program = pdflatex  
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber]{biblatex} 
\usepackage[colorlinks,breaklinks=true]{hyperref}

For the second part, I have no idea. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.