1

Consider this minimal example

\documentclass[aps,longbibliography]{revtex4-1}
\usepackage{hyperref}
\begin{document}

\cite{Caves1981,Holland1993}

\bibliography{library}
\end{document}

The content of the file library.bib:

@article{Caves1981,
  title = {{Quantum-mechanical noise in an interferometer}},
  author = {Caves, Carlton M.},
  journal = {Phys. Rev. D},
  volume = {23},
  issue = {8},
  pages = {1693},
  numpages = {0},
  year = {1981},
  month = {Apr},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevD.23.1693}
}

@article{Holland1993,
  title = {{Interferometric detection of optical phase shifts at the Heisenberg limit}},
  author = {Holland, M. J. and Burnett, K.},
  journal = {Phys. Rev. Lett.},
  volume = {71},
  issue = {9},
  pages = {1355},
  numpages = {0},
  year = {1993},
  month = {Aug},
  publisher = {American Physical Society},
  doi = {10.1103/PhysRevLett.71.1355},
}

The generated PDF has two entries in the bibliography, with the journal reference linking to the article DOI. But clicking on the first one does nothing (tried with multiple PDF readers), while the second works fine.

If I remove longbibliography from the class options, the two links works as expected.

Why does this happen?

I generated this with MacTeX 2018.

4
  • 1
    Which pdf viewers did you try? Both links work fine in adobe reader Commented Oct 12, 2018 at 16:43
  • @samcarter Preview and Skim on the Mac. But it is true, the links open correctly on Acrobat. Then probably this is a bug in the MacOS PDF framework. My colleagues could reproduce it on their Macs. Commented Oct 13, 2018 at 9:22
  • Links in mac preview are a difficult subject. Instead of just using the hyperref information tex is embedding it tries to be smart and recognise links on its own which often cause problems. Commented Oct 13, 2018 at 11:23
  • @samcarter I filed a report to Apple. Is there any discussion on this issue somewhere? Commented Oct 14, 2018 at 8:56

1 Answer 1

4

Update, this is no longer a problem with the latest version of REVTeX 4.2. As pointed out by my old post this got fixed by no longer using the \doibase command. In the new version the stack.bbl directly appends the string https://doi.org/ to the doi number, without the possibility of blank spaces appearing between those two.


It looks like this happens both because Preview/Skim handle links different than Acrobat as mentioned, a little of misfortune of the Latex compiler, and fortune of the doi website. The links in the bibliography are created in the aux file stack.bbl using the \href command. In order for the links to work they are appended to the string http://dx.doi.org/. So that the link in the PDF goes to http://dx.doi.org/10.1103/PhysRevD.23.1693 . You can check that by clicking on Copy link after right clicking on it. The problem arises because this appending is done by first defining the command \doibase, which holds the string http://dx.doi.org/, and then putting this command before the doi numbers, like \doibase 10.1103/PhysRevD.23.1693 . If for some reason the doibase command appears at the end of a line and the doi number in the beginning of the next one in the automatically created bbl file, then the hyperlink points to 'http://dx.doi.org/ 10.1103/PhysRevLett.71.1355' (note the space between the website and the doi number). Preview and Skim do not recognize the link because of this blank space, Acrobat does and directs you to 'http://dx.doi.org/%2010.1103/PhysRevD.23.1693' where %20 represents the blank space that Acrobat puts in order for the link to be valid. Finally, fortunately the doi website ignores the %20 and looks for the correct DOI.

I do not how to solve it automatically but only by manually opening the .bbl file, making sure all the doibase commands appear in the same line than the doi number, and then compiling bibtex again without erasing the aux files. This is not convenient since if for some reason you need to recompile from scratch and erase the aux files, you will have to again modify manually the .bbl file.

You can check that the links work in Preview/Skim if you replace the stack.bbl file with the following one where I made sure to put the doibase command in the same line as the doi number.

%merlin.mbs apsrev4-1.bst 2010-07-25 4.21a (PWD, AO, DPC) hacked
%Control: key (0)
%Control: author (0) dotless jnrlst
%Control: editor formatted (1) identically to author
%Control: production of article title (0) allowed
%Control: page (1) range
%Control: year (0) verbatim
%Control: production of eprint (0) enabled
\begin{thebibliography}{2}%
\makeatletter
\providecommand \@ifxundefined [1]{%
 \@ifx{#1\undefined}
}%
\providecommand \@ifnum [1]{%
 \ifnum #1\expandafter \@firstoftwo
 \else \expandafter \@secondoftwo
 \fi
}%
\providecommand \@ifx [1]{%
 \ifx #1\expandafter \@firstoftwo
 \else \expandafter \@secondoftwo
 \fi
}%
\providecommand \natexlab [1]{#1}%
\providecommand \enquote  [1]{``#1''}%
\providecommand \bibnamefont  [1]{#1}%
\providecommand \bibfnamefont [1]{#1}%
\providecommand \citenamefont [1]{#1}%
\providecommand \href@noop [0]{\@secondoftwo}%
\providecommand \href [0]{\begingroup \@sanitize@url \@href}%
\providecommand \@href[1]{\@@startlink{#1}\@@href}%
\providecommand \@@href[1]{\endgroup#1\@@endlink}%
\providecommand \@sanitize@url [0]{\catcode `\\12\catcode `\$12\catcode
  `\&12\catcode `\#12\catcode `\^12\catcode `\_12\catcode `\%12\relax}%
\providecommand \@@startlink[1]{}%
\providecommand \@@endlink[0]{}%
\providecommand \url  [0]{\begingroup\@sanitize@url \@url }%
\providecommand \@url [1]{\endgroup\@href {#1}{\urlprefix }}%
\providecommand \urlprefix  [0]{URL }%
\providecommand \Eprint [0]{\href }%
\providecommand \doibase [0]{http://dx.doi.org/}%
\providecommand \selectlanguage [0]{\@gobble}%
\providecommand \bibinfo  [0]{\@secondoftwo}%
\providecommand \bibfield  [0]{\@secondoftwo}%
\providecommand \translation [1]{[#1]}%
\providecommand \BibitemOpen [0]{}%
\providecommand \bibitemStop [0]{}%
\providecommand \bibitemNoStop [0]{.\EOS\space}%
\providecommand \EOS [0]{\spacefactor3000\relax}%
\providecommand \BibitemShut  [1]{\csname bibitem#1\endcsname}%
\let\auto@bib@innerbib\@empty
%</preamble>
\bibitem [{\citenamefont {Caves}(1981)}]{Caves1981}%
  \BibitemOpen
  \bibfield  {author} {\bibinfo {author} {\bibfnamefont {Carlton~M.}\
  \bibnamefont {Caves}},\ }\bibfield  {title} {\enquote {\bibinfo {title}
  {{Quantum-mechanical noise in an interferometer}},}\ }\href 
  {\doibase 10.1103/PhysRevD.23.1693} {\bibfield  {journal} {\bibinfo  {journal} {Phys.
  Rev. D}\ }\textbf {\bibinfo {volume} {23}},\ \bibinfo {pages} {1693}
  (\bibinfo {year} {1981})}\BibitemShut {NoStop}%
\bibitem [{\citenamefont {Holland}\ and\ \citenamefont
  {Burnett}(1993)}]{Holland1993}%
  \BibitemOpen
  \bibfield  {author} {\bibinfo {author} {\bibfnamefont {M.~J.}\ \bibnamefont
  {Holland}}\ and\ \bibinfo {author} {\bibfnamefont {K.}~\bibnamefont
  {Burnett}},\ }\bibfield  {title} {\enquote {\bibinfo {title}
  {{Interferometric detection of optical phase shifts at the Heisenberg
  limit}},}\ }\href {\doibase 10.1103/PhysRevLett.71.1355} {\bibfield
  {journal} {\bibinfo  {journal} {Phys. Rev. Lett.}\ }\textbf {\bibinfo
  {volume} {71}},\ \bibinfo {pages} {1355} (\bibinfo {year}
  {1993})}\BibitemShut {NoStop}%
\end{thebibliography}%
1
  • Very interesting, I wonder if this should somehow be considered as a bug of bibtex, and where to report it. Commented May 29, 2020 at 10:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .