4

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

5
  • 2
    BibTeX is not very fond of file names with whitespace. Try to drop all spaces in file names. What exactly did you write as argument to \bibliography in your document?
    – moewe
    May 10 '19 at 15:53
  • 1
    I should say that Bu\ifmmode \check{z}\else \v{z}\fi{}ek looks extremely suspicious (if not to say outright wrong). See tex.stackexchange.com/q/57743/35864 for hints on writing accented characters in .bib files.
    – moewe
    May 10 '19 at 15:54
  • \bibliography{test} @moewe
    – Govind
    May 10 '19 at 16:16
  • I just copied the downloaded the bibtex file from aps site and made test.bib file using JabRef. I haven't changed the font. I'll try changing the font now and let you know. @moewe
    – Govind
    May 10 '19 at 16:19
  • Changing the author name didn't help. Can you check this log file also? i.stack.imgur.com/Jr54E.jpg @moewe
    – Govind
    May 10 '19 at 16:31
4

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}
3
  • 1
    Is filecontents package used for creating the .bib file directly from the tex file? @Mico
    – Govind
    May 10 '19 at 17:24
  • Thanks. Its working correctly. @Mico
    – Govind
    May 10 '19 at 18:02
  • 1
    @Govind - Indeed, the fileconents environment lets you write to external files from within a LaTeX document.
    – Mico
    May 10 '19 at 20:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.