[Tex/LaTex] linking collection and incollection

biblatexlinks

Is there a way in Biblatex to have a link in an incollection entry that creates a hyperlink to the title of the collection entry if it also appear in the bibliography.

So for example if I have:

 @incollection{Farrer1965Christian,
    author  = {Farrer, Austin},
    editor  = {Jocelyn Gibb},
    year    = 1965,
    title   = {The Christian Apologist},
    booktitle   = {Light on C.S. Lewis},
    publisher   = { Harcourt, Brace \& World},
    address = {New York, NY}
}

I would like the booktitle to be as hyperlink to the booktitle in

@collection{Gibb1965Light,
  editor = "Gibb, Jocelyn",
   booktitle     = "{Light on C.S. Lewis}",
   publisher    = {Harcourt, Brace \& World},
    address = {New York, NY}, 
   year           = 1965
 }

without doing it manually.

What I would really like is not to have to include the publisher, address and editor in the first entry.

Best Answer

NB you will need to run Biber (backend=biber) for what follows.

Second things first: You do not have to retype all the information from the @collection for the @incollection, if you use Biber's awesome crossref field.

@incollection{Farrer1965Christian,
  author   = {Farrer, Austin},
  title    = {The Christian Apologist},
  crossref = {Gibb1965Light},
}
@collection{Gibb1965Light,
  editor   = {Gibb, Jocelyn},
  title    = {Light on C.S. Lewis},
  publisher= {Harcourt, Brace \& World},
  address  = {New York, NY}, 
  year     = {1965},
}

Farrer1965Christian will automatically inherit all the needed fields in the right meaning, i.e. Gibb1965Light's title will become Farrer1965Christian's booktitle.

For the clickable hyperlink to the booktitle, try the following modification. It should work for all standard styles, but I'm not to sure about others.

This links to the crossref entry if it is not empty. Note that in some situations this might go wrong (suppose the crossref'd entry did not supply the booktitle).

\renewbibmacro*{booktitle}{%
  \ifboolexpr{
    test {\iffieldundef{booktitle}}
    and
    test {\iffieldundef{booksubtitle}}
  }
    {}
    {\iffieldundef{crossref}
      {\printtext[booktitle]{%
         \printfield[titlecase]{booktitle}%
         \setunit{\subtitlepunct}%
         \printfield[titlecase]{booksubtitle}}}%
      {\bibhyperref[\thefield{crossref}]{\printtext[booktitle]{%
         \printfield[titlecase]{booktitle}%
         \setunit{\subtitlepunct}%
         \printfield[titlecase]{booksubtitle}}}}
     \newunit}%
  \printfield{booktitleaddon}}

An MWE

\documentclass{article}
\usepackage[backend=biber,firstinits=true,citestyle=numeric-comp,backref=true]{biblatex}
\usepackage{hyperref}
\usepackage{lipsum}

\begin{filecontents}{\jobname.bib}
@incollection{Farrer1965Christian,
  author   = {Farrer, Austin},
  title    = {The Christian Apologist},
  crossref = {Gibb1965Light},
}
@collection{Gibb1965Light,
  editor   = {Gibb, Jocelyn},
  title    = {Light on C.S. Lewis},
  publisher= {Harcourt, Brace \& World},
  address  = {New York, NY}, 
  year     = {1965},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\renewbibmacro*{booktitle}{%
  \ifboolexpr{
    test {\iffieldundef{booktitle}}
    and
    test {\iffieldundef{booksubtitle}}
  }
    {}
    {\iffieldundef{crossref}
      {\printtext[booktitle]{%
         \printfield[titlecase]{booktitle}%
         \setunit{\subtitlepunct}%
         \printfield[titlecase]{booksubtitle}}}%
      {\bibhyperref[\thefield{crossref}]{\printtext[booktitle]{%
         \printfield[titlecase]{booktitle}%
         \setunit{\subtitlepunct}%
         \printfield[titlecase]{booksubtitle}}}}
     \newunit}%
  \printfield{booktitleaddon}}

%COMMENCE
\begin{document}
  \lipsum
  Test citation by \cite{Farrer1965Christian} and \cite{Gibb1965Light}.
  \printbibliography
\end{document}

enter image description here

Related Question