TransWikia.com

RevTex 4-2: Package babel Error: You haven't defined the language en yet

TeX - LaTeX Asked on October 22, 2020

I am RevTex version 4-2 in combination with a Zotero-generated bib file. The bib file contains a lot of “random” entries in the “Language” field, such as “en”, “eng”, etc. These entries were automatically generated when adding the papers. RevTex 4-1 could deal with this bib file just fine. However, with RevTex 4-2, I get a lot of babel error messages related to the bibliography.

My question is: Is there any way to ignore the “Language” field in the bib file with RevTex 4-2, as it was apparently done in RevTex 4-1?

Note: I would like to avoid any solutions that require me to manually change > 1000 entries in my paper database to remove or correct the language entry.

Edit. Here is a minimal example:

documentclass{revtex4-2}
usepackage[english]{babel}
begin{document}
nocite{kubota_stress-induced_2012}
nocite{kubota_stress-induced_2012_2}
% bibliographystyle{apsrev4-1}
bibliography{references}
end{document}

Where references.bib reads

@article{kubota_stress-induced_2012,
    title = {Stress-{Induced} {Perpendicular} {Magnetization} in {Epitaxial} {Iron} {Garnet} {Thin} {Films}},
    volume = {5},
    issn = {1882-0786},
    url = {https://iopscience.iop.org/article/10.1143/APEX.5.103002/meta},
    doi = {10.1143/APEX.5.103002},
    language = {en},
    number = {10},
    urldate = {2019-09-07},
    journal = {Applied Physics Express},
    author = {Kubota, Masashi and Tsukazaki, Atsushi and Kagawa, Fumitaka and Shibuya, Keisuke and Tokunaga, Yusuke and Kawasaki, Masashi and Tokura, Yoshinori},
    month = sep,
    year = {2012},
    pages = {103002}
}


@article{kubota_stress-induced_2012_2,
    title = {Stress-{Induced} {Perpendicular} {Magnetization} in {Epitaxial} {Iron} {Garnet} {Thin} {Films}},
    volume = {5},
    issn = {1882-0786},
    url = {https://iopscience.iop.org/article/10.1143/APEX.5.103002/meta},
    doi = {10.1143/APEX.5.103002},
    number = {10},
    urldate = {2019-09-07},
    journal = {Applied Physics Express},
    author = {Kubota, Masashi and Tsukazaki, Atsushi and Kagawa, Fumitaka and Shibuya, Keisuke and Tokunaga, Yusuke and Kawasaki, Masashi and Tokura, Yoshinori},
    month = sep,
    year = {2012},
    pages = {103002}
}

When I un-comment the bibliographystyle line, everything works fine. It seems that the new bibliographystyle changes the .bbl title entry from

bibfield  {title}{bibinfo {title} {Stress-{Induced} {Perpendicular} ...

to

bibfield  {title}{{selectlanguage {en}bibinfo {title} {Stress-{Induced} {Perpendicular} ...

I guess one has to edit the bst file, or just use the old style.

One Answer

I recommend you to install the Better BibTeX for Zotero. It solves many issues with BibTeX export. When you have Better BibTeX installed, you can skip the export of language fields.

In Zotero, select Edit -> Preferences -> Better BibTeX -> Export and set Fields to omit from export to "language"

enter image description here

Correct answer by rouckas on October 22, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP