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.
1 Answers
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.
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}
- 506,678
-
1Is filecontents package used for creating the .bib file directly from the tex file? @Mico – Govind May 10 '19 at 17:24
-
-
1@Govind - Indeed, the
fileconentsenvironment lets you write to external files from within a LaTeX document. – Mico May 10 '19 at 20:24


\bibliographyin your document? – moewe May 10 '19 at 15:53Bu\ifmmode \check{z}\else \v{z}\fi{}eklooks extremely suspicious (if not to say outright wrong). See https://tex.stackexchange.com/q/57743/35864 for hints on writing accented characters in.bibfiles. – moewe May 10 '19 at 15:54