[Tex/LaTex] Revtex 4.2 Bibliography not working

bibtexpdftexrevtex

My tex file is running without any issue. But when I try to incorporate bibliography, the references are not getting generated. I've added the citation to bib file using JabRef and also defined the citation style correctly. I'm using revtex 4.2 for typing my article.

Bib log generated
Tex log generated

Best Answer

Do make sure that your tex file doesn't include any whitespace characters in the file name.

If the name of the tex file is 1st draft updated.tex, LaTeX creates an associated aux file named 1st draft updated.aux. Among the pieces of information written to the aux file are the name(s) of the bib file(s), the bibliography style that's supposed to be employed, and the arguments of \cite-like instructions. BibTeX peruses the aux file, not the tex file, in order to find out what it's supposed to do. As you've (re)discovered, BibTeX cannot handle whitespace characters in file names.

Summing up: The issue you've encountered is not related to either the revtex4-2 document class or the apsrev4-2 bibliography style. To "fix" the problem, simply change the name of the tex file from 1st draft updated.tex to 1stdraftupdated.tex (or some other name that doesn't contain space characters) and perform a full recompile cycle: LaTeX, BibTeX, and LaTeX twice more.

enter image description here

The name of the file that the contains the following code is test.tex -- note the absence of whitespace.

%%% test.tex
\RequirePackage{filecontents}
\begin{filecontents}{ttt.bib}
@article{hillery1999,
  title    = {Quantum secret sharing},
  author   = {Hillery, Mark and Bu{\v z}ek, Vladim{\'i}r and Berthiaume, Andr{\'e}},
  journal  = {Phys.\ Rev.~A},
  volume   = {59},
  issue    = {3},
  pages    = {1829--1834},
  numpages = {0},
  year     = {1999},
  month    = {Mar},
  publisher= {American Physical Society},
  doi      = {10.1103/PhysRevA.59.1829},
  url      = {https://link.aps.org/doi/10.1103/PhysRevA.59.1829}
}
\end{filecontents}

\documentclass{revtex4-2}
\bibliographystyle{apsrev4-2}
\frenchspacing % optional
\begin{document}
\cite{hillery1999}
\bibliography{ttt}
\end{document}
Related Question