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:
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.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.
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.
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},
}
revtexdoes not usebiblatex, butnatbib(which is incompatible withbiblatex), so I have removed the tag. Indeed this is part of the problem (2): Your.bibfile exports thebiblatexfieldsjournaltitle,dateandurldate, which revtex's bibliography style does not know. You need to use theyearfield instead ofdateandjournalinstead ofjournaltitle. Presumably you just need to tell your exporter to use BibTeX conventions rather thanbiblatexconventions. – moewe Jun 04 '23 at 07:07revtex4also exists butrevtex4-2should be preferred; 2. you need to supply a year (https://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.