3

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.

3
  • Have you asked zotero support how you can correct the wrong output of that software? Seems to be more an issue with zotero and not LaTeX ...
    – Mensch
    Commented Sep 16, 2019 at 16:11
  • I understand this comment but given that RevTex 4-1 and many other classes seem to be fine with ignoring the Language field in bib files, I'd like to understand if that can also be achieved with RevTex 4-2. Frankly, I don't see a reason why the Language field should be evaluated.
    – Felix
    Commented Sep 16, 2019 at 16:40
  • Well, then please show us a short compilable tex code resulting in your issue. Please do not forget to add two used bib entries to your question ... Did you only change the documentclass or did you also change from BiBTeX to BibLaTeX/Biber?
    – Mensch
    Commented Sep 16, 2019 at 16:57

2 Answers 2

4

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

3
  • 2
    Very useful! I had to play around a bit to make the better bibtex keys the same as the original zotero keys, to not break compatibility with my old documents. In case this is relevant for someone else, here is my citation key pattern: [auth:lower]_[Title:lower:select=1,1]_[year]
    – Felix
    Commented Sep 17, 2020 at 8:06
  • 1
    [zotero] gets you the original zotero key algorithm.
    – retorquere
    Commented Oct 12, 2020 at 11:39
  • NOTE 1: Applies only to FULL export for complete bib, not to selected items export. NOTE 2: The picture shown is slightly different in latest BBT release, however omitting 'language' can be set.
    – user236748
    Commented Feb 25, 2022 at 12:21
0

I had the exact same issue. Having language = {en}, for many entries, and some of them entered manually, I'd like to avoid re-generating Zotero's output (mine and co-authors)... a pain.

My solution is to shortcut selectlanguage, since it's useless, by doing: \renewcommand{\selectlanguage}[1]{}

a bit before \begin{document}. This way it's as if you had deleted the entry about language, that we don't care about anyway, but in a single line.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .