2

I recently made the switch from natbib to biblatex. I've been using \hypersetup to make active links with natbib––it helps me navigate my document as I am working on it (see below for example).

\citepalias and \citeauthor does not generate hyperlinks when used under biblatex. biblatex's \citet and \citep works great, but my homemade (i.e. using \citepalias) ibid. doesn't generate hyperlinks (I solved the striked part, see update below).

Is there a better way to get active links with biblatex?

natbib half ass

Here is a small example using the LaTeX below in a file called `main.tex’

\begin{filecontents}{\jobname.bib}
@book{veblen1919place,
  title={The Place of Science in Modern Civilisation: and other essays},
  author={Veblen, Thorstein},
  year={1919},
  publisher={BW Huebsch}
}
@book{veblen2007theory,
  title={The theory of the leisure class},
  author={Veblen, Thorstein},
  year={2007},
  publisher={Oxford University Press},
 url = {http://www.test.org}
}
\end{filecontents}

\documentclass{article}

\usepackage[style=authoryear, natbib=true, backend=bibtex]{biblatex}


\usepackage{hyperref}
            \hypersetup{
          pdfborderstyle={/S/U/W 1} % thanks, https://tex.stackexchange.com/a/26085/22939
                         }

\addbibresource{\jobname.bib}

\begin{document}

 \defcitealias{veblen1919place}{ibid.:~}     

\noindent 
As \citeauthor*{veblen2007theory} has argued \citep[12--19]{veblen1919place} it is clear that $y$. Second,  \citet[12]{veblen1919place} also show $m$ and $x$ \citepalias[37]{veblen1919place}.

\printbibliography
\end{document}

Update 2015-02:06 23:34:18Z

With the help of this answer (and this for title) I’ve solved my issue with \citeauthor.

Here iss the code

\DeclareCiteCommand{\citeauthor}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexnames{labelname}}
     {}%
   \printtext[bibhyperref]{\printnames{labelname}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

  \DeclareCiteCommand{\citetitle}
  {\boolfalse{citetracker}%
   \boolfalse{pagetracker}%
   \usebibmacro{prenote}}
  {\ifciteindex
     {\indexfield{indextitle}}
     {}%
   \printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

Look after update after update

  • Welcome to TeX-sx! The natbib option for biblatex is meant to ease the transition from the former to the latter. If you use the 'native' biblatex interfaces linking should be fine: is there a reason you are not? – Joseph Wright Feb 6 '15 at 19:57
  • @JosephWright, thank you for your fast and friendly response. I think I’m using natbib=true mainly because I come straight from natbib. I took a look at the default biblatex cite commands and didn’t see any replacement for the \citeauthor and \citepalias commands. In particular the latter is important for me as I use it to randomly create aliases (a feature I quite appreciate). But maybe there is a smart way around this using biblatex? – uT5r Feb 6 '15 at 20:09
  • 1
    biblatex has four \citeauthor commands, though I'm not sure how it compares to natbib's. If you are going to use \defcitealias to print 'ibid.', this is solvable by simply \cite-ing the same work two times in a row: biblatex has quite a sophisticated 'ibidtracker'. – jon Feb 6 '15 at 23:16
3

biblatex's natbib-like commands \citepalias and \citetalias (whose definitions can be found in blx-natbib.def) can be turned into hyperlinked versions just as easily as the other commands

\makeatletter
\DeclareCiteCommand{\citetalias}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\@citealias{\thefield{entrykey}}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citepalias}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\@citealias{\thefield{entrykey}}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\makeatother

Note the \makeatletter/\makeatother commands are needed in order for the @ in \@citealias to work.

MWE

\documentclass{article}
\usepackage[style=authoryear, natbib=true, backend=bibtex]{biblatex}
\usepackage{hyperref}
\makeatletter
\DeclareCiteCommand{\citetalias}
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\@citealias{\thefield{entrykey}}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\DeclareCiteCommand{\citepalias}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
   \printtext[bibhyperref]{\@citealias{\thefield{entrykey}}}}
  {\multicitedelim}
  {\usebibmacro{postnote}}
\makeatother
\addbibresource{biblatex-examples.bib}

\defcitealias{cicero}{DND} 

\begin{document}
As \citeauthor*{cicero} has argued  \citep[12]{cicero} it is clear that $y$. Second,  \citet[12]{cicero} also show $m$ and $x$ \citepalias[12]{cicero}.

\printbibliography
\end{document}

enter image description here

In your use-case though, it seems much more appropriate to use a style that can do the "ibid"-work for you, in your case probably authoryear-ibid. Then there is no need to awkwardly alias an entry to "ibid" and biblatex tries its best to avoid ambiguous "ibid" citations for you.

| improve this answer | |
  • Perfect! I do want to do it awkwardly in my case as I am only using "ibid" inside some tables where the author(s) would take up too much place. Thank you for solving my problem! – uT5r Feb 9 '15 at 18:58

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.