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 have prepared the following MWE from the answer I found at formatting-back-references-in-bibliography. If the option backref=page is forwarded to hyperref with \hypersetup then the back references do not appear. But passing this option while calling the package works. Why is this?

MWE

\documentclass{article}

\usepackage[numbers]{natbib}

%\usepackage[backref=page]{hyperref}

\usepackage{hyperref}
\hypersetup{
  backref=page
}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{B02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
}
\end{filecontents}

\begin{document}

Some text \citep{A01,B02}.

\clearpage

Some more text \citep{A01}.

\bibliographystyle{plainnat}
\bibliography{\jobname}

\end{document}
share|improve this question

1 Answer 1

up vote 3 down vote accepted

Note from the hyperref manual:

Some options can be given at any time, but many are restricted: before \begin{document}, only in \usepackage[...]{hyperref}, before first use, etc.

hyperref disables the backref option when the package is loaded. The reason for this restriction with backref is simply to make the implementation easier. (Note that it is supported to put the \hypersetup{backref} in hyperref.cfg.)

Note the warning you get when attempting to set the backref option after it has been disabled:

Package hyperref Warning: Option `backref' has already been used,
(hyperref)                setting the option has no effect on input line 10.

This is the standard warning text for disabled hyperref options, and is perhaps a bit misleading. It should say that the option has to be specified sooner.

share|improve this answer
    
I should have looked at the warning. I am using silent package. On another note, referencing to your answer for tex.stackexchange.com/questions/54541/… , has the patch been tested with natbib? Are there any known issues? –  devendra Dec 29 '12 at 11:30
    
@devendra: I have just updated my answer there for natbib support. Only time will tell what issues remain... –  cyberSingularity Dec 29 '12 at 12:23

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.