0

I'm working on a paper using the revtex4 document class (which is mandatory), but I'm experiencing significant issues with citations, references, and the bibliography:

  1. First of all, I have to add \RequirePackage[2020-02-02]{latexrelease} at the beginning of the document to avoid the following error: "Extra \endgroup. \document ->\endgroup" which prevents the PDF file from being generated. This issue occurs when working in VS Code but not in Overleaf.

  2. Question marks appear in several citations. For example:

"[1] J. D. Bekenstein, 7, 2333 (????), ISSN 0556-2821, URL https://link.aps.org/doi/10.1103/PhysRevD.7.2333." Also, I'm unsure if this is the correct citation format.

  1. When adding the "hyperref" package, it introduces strange indentation in the bibliography, and the formatting of equation and figure references changes. Equations transition from simple numbering to a format that includes "equation" and the section number. Figures transition from simple numbering to a strange format similar to equations, where "equation" is also included.

  2. If I use the "revtex4-2" class, the bibliography shifts, and the references and citations appear as question marks (note that the bibliography still appears). Additionally, hyperref doesn't work. I am unsure if this format differs visually from the other format, so I am unsure if I can use it for this work.

This is my first post, and any feedback is welcome. I can also provide an example PDF with the desired document format if needed.

Thank you in advance.

Code sample:

\RequirePackage[2020-02-02]{latexrelease}
\documentclass[twocolumn]{revtex4}

% \documentclass[twocolumn]{revtex4}

% \RequirePackage[2020-02-02]{latexrelease}
% \documentclass[twocolumn]{revtex4-2}

\usepackage[hidelinks]{hyperref}

\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{mathtools}
\usepackage{float}
\usepackage{csvsimple}
\providecommand{\abs}[1]{\lvert#1\rvert}
\usepackage{braket}
\providecommand{\eq}[2]{
    \begin{equation}
        #2
    \label{eq:#1}
    \end{equation}
}
\providecommand{\eqgat}[2]{
    \begin{gather}
        #2
    \label{eq:#1}
    \end{gather}
}
\usepackage{amsmath}
\usepackage{amsfonts}
\DeclareMathOperator{\calA}{\mathcal{A}}
\DeclareMathOperator{\calB}{\mathcal{B}}
\DeclareMathOperator{\calH}{\mathcal{H}}
\DeclareMathOperator{\tr}{tr}
\usepackage{fancyhdr}
\usepackage{wrapfig}
\usepackage{graphicx}


\begin{document}

\pagestyle{fancy}
\lhead{\bf Title}
\rhead{Author}
\lfoot{Left foot}
\rfoot{Right foot}

\title{Title}
\author{Author: ---}
\email{Email} %optional
\affiliation{Affiliation}
\author{Advisor: ---}
%\date{\today}

\begin{abstract}
    {\bf Abstract:} Abstract
\end{abstract}

\maketitle

\section{Section 1} \label{s:1}

\subsection{Subsection 2} \label{ss:2}

---
\eq{3}{
    \calA = \calB
}
---

Reference: Eq.~\ref{eq:3}.

Citation: \cite{bekenstein_black_1973}

\newpage

\section{Conclusions} \label{s:Conclusions}

---

\begin{acknowledgments}
    ---
\end{acknowledgments}

\bibliography{zz.bib}

\end{document}

BibLaTex file sample:

@article{bekenstein_black_1973,
    title = {Black Holes and Entropy},
    volume = {7},
    issn = {0556-2821},
    url = {https://link.aps.org/doi/10.1103/PhysRevD.7.2333},
    doi = {10.1103/PhysRevD.7.2333},
    pages = {2333--2346},
    number = {8},
    journaltitle = {Physical Review D},
    shortjournal = {Phys. Rev. D},
    author = {Bekenstein, Jacob D.},
    urldate = {2023-04-11},
    date = {1973-04-15},
    langid = {english},
}
5
  • Welcome to tex,sx. Commented Jun 4, 2023 at 1:34
  • Please ask only about one issue per question. That way your question is easier to answer and more helpful for other people as well. See tex.meta.stackexchange.com/q/7425/35864
    – moewe
    Commented Jun 4, 2023 at 6:59
  • 1
    revtex does not use biblatex, but natbib (which is incompatible with biblatex), so I have removed the tag. Indeed this is part of the problem (2): Your .bib file exports the biblatex fields journaltitle, date and urldate, which revtex's bibliography style does not know. You need to use the year field instead of date and journal instead of journaltitle. Presumably you just need to tell your exporter to use BibTeX conventions rather than biblatex conventions.
    – moewe
    Commented Jun 4, 2023 at 7:07
  • Thank you for responding. The issues with the bibliography have been solved by using BibTeX, so thank you for that. Actually, I knew I should use BibTeX, and that's what I was using previously, but for some reason, with all the problems, I ended up using BibLaTeX. Silly mistake. Could you help me with the usage of Hyperref? Thank you.
    – Ferran RM
    Commented Jun 4, 2023 at 18:35
  • 1. This should be resolved by updating, you likely don't have revtex 4.2e (tex.stackexchange.com/q/565215/106162), a commensurate update to revtex4 also exists but revtex4-2 should be preferred; 2. you need to supply a year (tex.stackexchange.com/q/344416/106162); 3. Not sure, please update to revtex 4.2e and if still problematic please give an example; 4. Not sure, sounds a bit like you need an addition LaTeX compilation or have a dodgy bib entry, please update to revtex 4.2e and if still problematic please give an example.
    – Dai Bowen
    Commented Jun 12, 2023 at 19:18

0

You must log in to answer this question.

Browse other questions tagged .