18

I have long despaired of resolving the following glitch: If I am using hyperref with amsrefs, then all \cite links to the bibliography point to the line right below where they are supposed to. Here is an example document with the bad behavior and some other links that don't have this problem. In particular, note the target on the second page, which is exactly the code used in amsrefs.sty (lines 595--597) to (apparently) produce its targets.

\documentclass{article}
\usepackage{hyperref}
\usepackage{amsrefs}
\begin{document}
 \section{First}
 \ref{s:second}, \hyperlink{text}{link}, \cite{testbib}
 \newpage

 \section{Second}
 \label{s:second}
 \csname hyper@anchorstart\endcsname{text}Text\csname hyper@anchorend \endcsname

 \section{References}
 \begin{biblist}
  \bib{testbib}{article}{author={Ryan Reich},title={Title}}
 \end{biblist}
 \newpage
\end{document} 

What is the cause of this problem? It really bugs me. I have asked this on comp.text.tex but received no useful reply. Hopefully, it is appropriate for this site.

Ryan Reich
  • 37,958

1 Answers1

11

Here you go Ryan. This should fix it for you...

\usepackage{amsrefs}
\usepackage{hyperref}

\makeatletter
\renewcommand{\BibLabel}{%
  \Hy@raisedlink{\hyper@anchorstart{cite.\CurrentBib}\relax\hyper@anchorend}%
  [\thebib]%
}
\makeatother

\begin{document}...