3

I am trying to write a paper with

  • revtex4-2 document class (revtex4-2 2020/10/03 4.2e);
  • .bib file specifying language field for some entries;
  • cleveref package;
  • custom theorem (using \newtheorem command and \Crefname for references in cleveref to work correctly).

This, however, results in a compilation failure. Here is a minimal example:

min.tex:

\documentclass{revtex4-2}

\usepackage{babel}
\usepackage{cleveref}

\newtheorem{myproposition}{Proposition}
\Crefname{myproposition}{Proposition}{Propositions}

\begin{document}
\cite{web:lang:stats}
\bibliography{myrefs}
\end{document}

myrefs.bib:

@misc{web:lang:stats,
  author = {W3Techs},
  title = {Usage Statistics of Content Languages for Websites},
  language = {English},
  year = {2017},
  note = {Last accessed 16 September 2017},
  url = {http://w3techs.com/technologies/overview/content_language/all}
}

If I put these two files into the same directory with nothing else in it (remove all temp files from previous compilations to make a clean experiment) and run

pdflatex min.tex && bibtex min.aux && pdflatex min.tex

I get

! TeX capacity exceeded, sorry [input stack size=5000].
\extrasenglish ->\extrasenglish 
                                \crefname {myproposition}{\MakeLowercase Pro...
l.12 \babel@aux{english}{}

Why? What did I do wrong?

0

1 Answer 1

3

You need babel because of the language field in the bib item. But you need to pass a language to babel. Best to add the language in the global options to \documentclass, so also cleveref will pick it.

\begin{filecontents*}{\jobname.bib}
@misc{web:lang:stats,
  author = {W3Techs},
  title = {Usage Statistics of Content Languages for Websites},
    language = {English},
  year = {2017},
  note = {Last accessed 16 September 2017},
  url = {http://w3techs.com/technologies/overview/content_language/all}
}
\end{filecontents*}

\documentclass[english]{revtex4-2}

\usepackage{babel}
\usepackage{cleveref}

\newtheorem{myproposition}{Proposition}
\Crefname{myproposition}{Proposition}{Propositions}

\begin{document}
\cite{web:lang:stats}
\bibliography{\jobname}
\end{document}

On the other hand, if you just use (American) English, you can remove the language field in the bib item(s) and not load babel.

Note. I used filecontents* with \jobname.bib just not to clobber my files. Use your own file and remove filecontents*.

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.