Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I find myself frequently using the \citetitle and \citeauthor commands of biblatex. They are great commands, but they don't provide a hyperlink to the entry in the bibliography. TO overcome this, I have to use \citetitle{Knuth} \cite{Knuth} to get

The Art of Computer Programming [1]

where the [1] is hyperlinked to the bibliography. That doesn't look as nice as I would like.

What must I do to get a hyperlink to the bibliography by just using the \citetitle (or '\citeauthor`) command?

PS. I'm also using the hyperref package, but I think that's obvious.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

Both of these citations commands are defined in biblatex.def. To add links, you can redefine them in your document preamble or configuration file. A linked variant of \citeauthor is already addressed in this previous question. The \citetitle command can be revised similarly, although note that you may wish to swap the order of the bibhyperref and citetitle formats.

\DeclareCiteCommand{\citetitle}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexfield{indextitle}}
     {}%
   \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
share|improve this answer
    
That is a great answer. Sorry I didn't see the answer to \citeauthor in the previous question. I tried to do a similar thing for \fullcite but it didn't work. This is what I tried: \DeclareCiteCommand{\fullcite} {\usebibmacro{prenote}} {\usedriver {\DeclareNameAlias{sortname}{default}} {\printtext[bibhyperref]{\thefield{entrytype}}}} {\multicitedelim} {\usebibmacro{postnote}} –  Jeremy Apr 12 '13 at 17:17
    
@Jeremy You need to wrap the output of the bibliography driver in the format: \printtext[bibhyperref]{\usedriver{...}{...}}. But I don't know why you need this; the citation gives all of the bibliographic data and the link would only lead you to redundant information. Moreover it can lead to nested links if the entry contains an URL or DOI. It is possible to link just part of the driver output, but the solution depends on which part you choose. –  Audrey Apr 12 '13 at 19:50
    
thank, that did the trick. Your statement about the full citation being in the paper is a good one. I think I want the full citation in both places, but I'll have to reconsider now. –  Jeremy Apr 12 '13 at 19:56
    
@Jeremy I don't see a problem with repeating a full citation in the bibliography, just linking the them. The links are there to lead the reader to more detailed information about the citation. With a full citation the reader already has all the details. –  Audrey Apr 12 '13 at 20:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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