Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting "month = {season}" for BibTeX #1810

Closed
TheVoroscope opened this issue May 19, 2021 · 5 comments
Closed

Exporting "month = {season}" for BibTeX #1810

TheVoroscope opened this issue May 19, 2021 · 5 comments
Labels

Comments

@TheVoroscope
Copy link

TheVoroscope commented May 19, 2021

Per a request from @retorquere made in a Zotero Forum post I'm bringing this issue here to Git.

A week ago BBT was not exporting "Year Season" date fields from Zotero correctly via the automatic export to .bib files in ordinary BibTeX via the Better BibTeX .bib output -- the Year was being dropped entirely (and no Season was coming out). That was noted there, and a fix produced double-quick, with this code (in 5.4.13):

case 'season':
      ref.add({ name: 'year', value: date.year })
      ref.add({ name: 'month', value: ['', 'spring', 'summer', 'fall', 'winter'][date.season] })
break

As noted at the Zotero Forum, the use of "fall" would not be sufficient for (e.g.) GB or AU users, since the term used is "Autumn" t/here, so some extension to this case selector is needed (I do have a few refs with this season in my database, so they are not unknown). Hence the request to bring this here.

A quick check of the ISO 8601 Date-Time spec (as of 2019), interpreted at Extended Date Time Format, Level 1, Seasons shows (for use with BibLaTeX at least) that:

Seasons
The values 21, 22, 23, 24 may be used used to signify ' Spring', 'Summer', 'Autumn', 'Winter', respectively, in place of a month value (01 through 12) for a year-and-month format string.
Example 2001-21 Spring, 2001

which shows the use of "Autumn" instead of the North American usage of "Fall".

For my part, using the .bst BibTeX, "month = {Season}" kludge with {Autumn} added to the case selector would suffice (as per the advice at Stackexchange). Mileage may vary for others, especially for BibLaTeX, where some selector may end up being needed for Autumn/Fall selection (ISO says Autumn...).

Love BBT, BTW. ❤️👍

Support log ID:

@github-actions
Copy link

It looks like you did not upload an support log. The support log is important; it gives @retorquere your current BBT settings and a copy of the problematic reference as a test case so he can best replicate your problem. Without it, @retorquere is effectively blind. Support logs are useful for both analysis and for enhancement requests; in the case of export enhancements, @retorquere need the copy of the references you have in mind.

If you did try to submit a support log, but the ID looked like D<number>, that is a Zotero debug report, which @retorquere cannot access. Please re-submit a BBT debug log by one of the methods below. BBT support log IDs end in -apse or -euc. Support logs that include sample references will end in -refs-apse or -refs-euc; these are the type @retorquere needs for export or citekey issues.

This request is much more likely than not to apply to you, too, even if you think it unlikely, and even if it does not, there's no harm in sending a debug log that turns out to be unnecessary. @retorquere will usually just end up saying "please send a debug log first". Let's just skip over the unnecesary delay this entails. Sending a debug log is very easy, depending on your situation, follow one of these procedures::

  1. If your issue relates to how BBT behaves around a specific reference(s), such as citekey generation or export, select at least one of the problematic reference(s), right-click it, and submit an BBT support log from that popup menu. If the problem is with export, please do include a sample of what you see exported, and what you expected to see exported for these references, either by pasting it in a comment here (if it is small) or attaching it as a .txt file (if it's large). These logs will have an ID that ends in -refs-apse or -refs-euc.

  2. If the issue does not relate to references and is of a more general nature, generate an support log by restarting Zotero with debugging enabled (Help -> Debug Output Logging -> Restart with logging enabled), reproducing your problem, and selecting Send Better BibTeX debug report... from the help menu.

Once done, you will see a support log ID in red. Please post that support log id in an issue comment here.

Thank you!

@TheVoroscope
Copy link
Author

TheVoroscope commented May 19, 2021

Output from Chicago 17 full-note is:

Hinton, Leanne. Review of Hopi Time, by Ekkehart Malotki. American Indian Quarterly 12, no. 4 (Autumn 1988): 361–64. https://doi.org/10.2307/1184426.

Output to the .bib file is

@article{hinton88rht,
  title = {Hopi {{Time}}},
  author = {Hinton, Leanne},
  year = 1988,
  month = {fall},
  volume = {12},
  pages = {361--364},
  issn = {0095-182X (print); 1534-1828 (elec.)},
  doi = {10.2307/1184426},
  collaborator = {Malotki, Ekkehart},
  journal = {American Indian Quarterly},
  number = {4}
}

I'm less concerned about the mis-match between Reviewed Author in Zotero and the use of collaborator in the .bib, because that's not something BibTeX really understands (and would take too long to deal with). But the mis-match between Autumn and fall is visible above.

Support log ID: KGG3CGFG-refs-apse

@retorquere retorquere changed the title Exporting "month = {season}" for ordinary BibTeX (brought here from Zotero Forums) Don't export "month = {season}" for BibTeX May 19, 2021
@retorquere retorquere changed the title Don't export "month = {season}" for BibTeX Exporting "month = {season}" for BibTeX May 19, 2021
retorquere added a commit that referenced this issue May 19, 2021
@github-actions
Copy link

🤖 this is your friendly neighborhood build bot announcing test build 5.4.14.892 ("fixes #1810")

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

@retorquere
Copy link
Owner

retorquere commented May 19, 2021

Good point. 892 exports the year, not the season, and makes the season available in postscripts, so that one could do:

if (Translator.BetterBibTeX && reference.date.type === 'season') {
  reference.add({ name: 'month', value: ['', 'spring', 'summer', 'fall', 'winter'][reference.date.season] })
}

which I've added to the docs: https://retorque.re/zotero-better-bibtex/exporting/scripting/#export-season-for-bibtex

@TheVoroscope
Copy link
Author

Yep, works with the scripting option under the Advanced tab pref. 👍

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants