retorquere / zotero-better-bibtex

Make Zotero effective for us LaTeX holdouts
https://retorque.re/zotero-better-bibtex/
MIT License
5.28k stars 284 forks source link

edition as numeric cardinal instead of English ordinal #2480

Closed jsdodge closed 1 year ago

jsdodge commented 1 year ago

Debug log ID

DBZGVIHH-refs-euc

What happened?

In Zotero the "Edition" field is set to "7", which is automatically converted to "Seventh" in the bib-file. The publisher house style uses "7th", however, and as noted in this discussion, it would be helpful to have the ability to export the edition number for publications in languages other than English.

@book{born1999,
  title = {{Principles of Optics: Electromagnetic Theory of Propagation, Interference and Diffraction of Light}},
  author = {Born, M. and Wolf, E. and Bhatia, A. B. and Clemmow, P. C. and Gabor, D. and Stokes, A. R. and Taylor, A. M. and Wayman, P. A. and Wilcock, W. L.},
  year = {1999},
  edition = {Seventh},
  publisher = {Cambridge University Press},
  address = {Cambridge; New York},
  doi = {10.1017/CBO9781139644181}
}
retorquere commented 1 year ago

I think I'll just revert to the old behavior. Biblatex exports don't do this translation to English text btw, and if you have multilanguage bibliographies you'll be much better of with biblatex of you can use it for other reasons too.

jsdodge commented 1 year ago

Thanks. Unfortunately biblatex is not an option for me: it's incompatible with RevTeX, which is one of the standard packages used in physics.

retorquere commented 1 year ago

Still, what do you make of this:

edition The edition of a book—for example, “Second”. This should be an ordinal, and should have the first letter capitalized, as shown here; the standard styles convert to lower case when necessary.

7 is not an ordinal, it is a cardinal.

jsdodge commented 1 year ago

The Chicago Manual of Style recommends (14.113),

“When an edition other than the first is used or cited, the number or description of the edition follows the title in the listing. An edition number usually appears on the title page and is repeated, along with the date of the edition, on the copyright page. Such wording as Second Edition, Revised and Enlarged is abbreviated in notes and bibliographies simply as 2nd ed.; Revised Edition (with no number) is abbreviated as rev. ed. Other terms are similarly abbreviated.”

House styles will vary (as will the publication language), so it would be best to have some flexibility.

retorquere commented 1 year ago

I understand style demands can vary this way, it's precisely because of this that I want to know how bibtex and revtex go about meeting these various demands of different styles. The idea behind bibtex/biblatex is that they have a sort-of-universal generic format that they can translate in concert with the style files to the style-correct output. bibtex for its part seems to have settled on "always an ordinal" for edition, biblatex on a cardinal.

I have reached out to revtex and put you in BCC to see what their expectation is in relation to the bibtex expectations. If need be I'll add a new preference, but before I do that I need to hear from them. Or is revtex its own processor, separate from bibtex, that just uses a format that looks like bibtex?

If you need an immediate solution, a postscript could tide you over:

if (Translator.BetterBibTeX) {
  if (tex.has.edition) tex.add({ name: 'edition', value: zotero.edition })
}
jsdodge commented 1 year ago

Thanks, it's not urgent, and RevTeX is just a set of macros, including a LaTeX class file and BibTeX style files.

retorquere commented 1 year ago

It doesn't seem like they're going to get back to us.

retorquere commented 1 year ago

If they get back to you, you can comment here and the issue will automatically reopen.

jsdodge commented 1 year ago

I haven't heard back from the folks at the American Physical Society, but their example file includes multiple references that list the edition number in the abbreviated form that The Chicago Manual of Style recommends: Refs. [3], [8], [9], [32], and [42]. I'm including a couple of screenshots below. The Physical Review Style and Notation Guide does not give an example of a book reference that includes an edition number, but the available evidence indicates that Physical Review prefers the abbreviated form in references.

Regarding the reference that you cited above, both "Second" and "2nd" are ordinal numerals. I can't remember if I wrote the title for this issue, but the issue is not whether to represent the edition as a cardinal number or as an ordinal number, but whether the ordinal edition number should be abbreviated.

Screen Shot 2023-04-27 at 7 07 51 PM Screen Shot 2023-04-27 at 7 09 54 PM
retorquere commented 1 year ago

I've moved the ordinal-ization to a preference so it can be turned on (off by default)

github-actions[bot] commented 1 year ago

:robot: this is your friendly neighborhood build bot announcing test build 6.7.79.4446 ("fixes #2480")

Install in Zotero by downloading test build 6.7.79.4446, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

github-actions[bot] commented 1 year ago

:robot: this is your friendly neighborhood build bot announcing test build 6.7.79.4447 ("preference")

Install in Zotero by downloading test build 6.7.79.4447, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".