Hej,
I just came accross and started using Better BibTex a day ago, so please apologize if I might oversee something obvious. And already big thanks to you for this add-on - no more manual editing of my .bib files any longer!
However, I have the following issue:
I want automatic abbreviation of journal titles. So I turned on the option "Automatically abbreviate journal title if not set explicitly" under the Better BibTeX preference pane/Journal abbreviations. And indeed, under Firefox's about:config the field 'extensions.zotero.translators.better-bibtex.autoAbbrev' is then set to 'true'. However, the abbreviation does not work, still the full journal name as it appears under Zotero is exported (using Cmd-Shift-C and "Better BibTeX" as export option), regardless of if a specific abbreviation is set in the respective Zotero field or not.
I can manually get the expected behaviour if I hack the 'Better BibTeX.js' file under Library/Application Support/Zotero/.../zotero/translators/, setting under "displayOptions" the field "useJournalAbbreviation" from false to true. However, the original setting is always restored after re-starting Better BibTex/firefox. Also, after hacking the file, choosing a different abbreviation style under the preferences apparently has no effect.
Many thanks for any help on this issue!
My system is:
I can't currently reproduce this (meaning "it works as expected for me"). Did you check the checkbox "use journal abbreviation" on export? You need to do both to get the abbrevs; the BBT prefs really literally means "Automatically abbreviate journal title if not set explicitly" -- if you have that enabled, _and_ you have "use journal abbrevs" on during export, _and_ the reference has a journal but not a journal abbrev, _then_ BBT will have Zotero generate a journal abbrev and use that.
Better BibTeX re-installs the translators every time it starts because I can't know whether they are installed & are the last version, sorry. I don't honestly know how the abbreviations are supposed to vary per style -- the styles you can select are simply the styles that Zotero reports it can do abbreviations for, and I just pass along any abbreviation I get from Zotero given that style.
As an aside: @njbart (is that you, @nickbart1980?), the current behavior wrt abbreviation for BibLaTeX (with "use Journal Abbrevs" on during export) is:
journal field. Generate no journaltitle field.journaltitle field.But that seems a little strange; I know I added the journaltitle field only later on your recommendation, but the abbrevs may have slipped through the cracks. If there is only a user-provided abbrev, no journal title, shouldn't that go in the journaltitle field? And what is supposed to happen if there is a user-provided journal title but also a generated or user-provided journal abbreviation?
Thanks for the quick reply. What I meant by "it works as expected for me" is: When I edit the translator file 'Better BibTeX.js' as I described, then I get a journal abbrev in the exported output when he reference has a journal but not a journal abbrev already set. But editing that file is of course not the proper solution after every start-up.
Anyway, if I understand right, I have to check two checkboxes: "Automatically abbreviate journal title if not set explicitly" _and_ "use journal abbreviation" on export. However, where under the preferences do I find the latter checkbox? There is no such under the Export tab of the normal Zotero preference pane, and neither under the Export tab of the Better BibTeX preferences...
It's in the popup you get when you export, where you choose the export format and export options. When you edit the file as you did, you simply changed the default for one of those option to "true".
Aah, ok, I got it! Using the right-click popup menu for exporting and ticking the checkbox there indeed does the right thing - thanks very much for pointing me on that! I never used the right-click export function before.
Thus, I may change this issue into a request:
My usual workflow is to use the quick-copy function (Cmd+Shift+C on Mac OS) for exporting references, setting the export format to Better BibTeX under the Export tab of the Zotero preferences. For this workflow, the behaviour is as described in my first thread, so apparently for quick-copy the default of Zotero is to _not_ use journal abbrev's, and ticking the "Automatically abbreviate journal title if not set explicitly" checkbox has no effect on quick-copy. It would be nice if one could change this for Better BibTeX.
However, I could also change my workflow and use the popup menu from now on, if there is no way of modifying the quick-copy behaviour...
I don't quite remember any previous discussions, but the biblatex manual lists two relevant fields:
journaltitle, with journal as an alias for backwards compatibility.shortjournal, “A short version or an acronym of the journaltitle. Not used by the standard bibliography styles.”So arguably any journal abbreviation should go into shortjournal.
I’m not sure whether there are any biblatex non-core styles that use shortjournal, but for _any_ style, users have the option to map the content of shortjournal to journaltitle at latex run-time, using biblatex’s \DeclareSourcemap functionality.
@thomas-muench I'm not being told whether the user did a quick export or a regular export, so I can't know whether you saw the popup or not. I could add an override, but again because I'm not being told whether you're doing a quick-copy or a regular export, this override would _always_ be used, and the settings in the export popup would be ignored. That seems undesirable behavior. So I don't really know how I'd do this. I also don't want to change this default because I think that the current behavior is better, as it follows the biblatex manual (see below).
@njbart that's what BBT already does. "use Journal Abbreviation" is usually interpreted (AFAICT) by Zotero and its translators as as "use journal abbreviation _instead of_ the journal title". If you have it off, the abbrev (whether generated or user-supplied) shows up in the shortjournal field. When the option is off on (which is not the default), it will be put in the journaltitle field instead.
(edit: correct, that last one should have read "on")
@retorquere I see and understand that there are good reasons to not change the current behaviour. Well, and I can certainly live with changing my habits and now use the regular export functionality ;-) Thanks for all the help and clarifications!
"use Journal Abbreviation" is usually interpreted (AFAICT) by Zotero and its translators as as "use journal abbreviation instead of the journal title". If you have it off, the abbrev (whether generated or user-supplied) shows up in the
shortjournalfield. When the option is off [on?], it will be put in thejournaltitlefield instead.
For bibtex this is certainly the only option to obtain abbreviations at all.
For biblatex one could argue that in the interest of flexibility at latex run-time, BBT should better not offer the “use Journal Abbreviation” preference for biblatex at all, but export the “Publication field” to journaltitle, and the “Journal Abbr” field (or, if this is empty, an automatically generated abbreviation) to shortjournal, and then let the users or their styles decide whether to use the abbreviated form or not.
@njbart I've corrected my earlier post. I see where you're coming from wrt an option that allows people to shoot themselves in the foot (sort of), but I'm conflicted about removing an option which people (such as @thomas-muench) apparently do use.
Yeah, I see that problem, of course. In general, I think it’d help a lot to get a better idea of which biblatex styles are actually used by the BBT clientele. – So, @thomas-muench, which one is it you’re using?
@thomas-muench, we could really use your feedback.
Please excuse my late response. I was pretty busy the last days and this issue here was not on top of my agenda...
First of all, I mostly use LaTeX for writing papers, and the journals I published in so far, all still use BibTeX for their bibliographies, so I am kind of bound to use that as well (although I will most likely use BibLaTeX for my thesis then...). Secondly, the scientific journals I know always use abbreviated journal titles in their bibliographies, so there is actually no need to export the full journal title at all. Thus, with this as a background, this was actually one reason for me to start using BetterBibTeX in order to no longer have to manually edit the journal titles in my bib files. So, I can live with using BetterBibTeX and the right-click export function to obtain what I need.
However, I certainly see the reason for a general solution to get most flexibility. But it took me some time to understand the general behaviour. Let me shortly summarise what I figured out by checking all possible combinations of the options (this might be of interest also for someone else who comes accross this issue):
Using quick-copy:
shortjournal field in addition to the full title in the journaltitle field.Using normal (right-click) export function:
journal field. Ticking only one of the options or none always exports the full title.journaltitle field and additionally abbrev. title in shortjournal field (as for quick-copy). Ticking both (1) and (2), the abreviated title is exported to the journal field, no journaltitle or shortjournal fields appear anymore.Hence, most flexible is BetterBibLaTeX, however, by ticking (1) and (2) in normal export results in losing this flexibility. But I have to say that for me as an average, non-expert LaTeX user, I do not know which BibLaTeX styles support the shortjournal field or how to use the mentioned \DeclareSourcemap functionality.
Nevertheless, I have to say that I find the described behaviour not straightforward and when you start using BetterBibTeX this is not all obvious. If at all possible, I would suggest the following change:
Remove the pop-menu option (2), only keep (1) with the following functionality: Ticking (1) exports abbrev. title when using BetterBibTeX for both quick-copy and normal export, and journaltitle and shortjournal field when using BetterBibLaTeX for both quick-copy and normal export. In my opinion, this would be the most consistent behaviour and would keep the flexibility for BibLaTeX.
I hope this "essay" somehow helps...;-)
The proposed behavior collapses what I think are two importantly distinct behaviors. Let my try to describe what happens in BBT/BBLT.
from the BBT prefs. It means "if the user has not filled out an abbrev manually, and this option is on, and it is possible to generate an abbrev from the journal title, act as if that abbrev was filled in manually by the user". Nothing more. I don't make this the default and certainly not enforced because I'm not universally pleased with the quality of the auto-abbrevs generated by Zotero. Enabling this option does not change BBTs behavior, it only changes what data is available to BBT.
This process does not always generate an abbreviation BTW. I simply ask Zotero "give me an abbrev for this reference", and use what it gives me. One obvious reason why this may not yield and abbrev is if the user did not enter a full journal title, but I don't know how the Zotero abbreviator works, and there may be other reasons why it won't give me an abbreviation.
in the export dialog. This is actually the most important of the two, as it changes how BBT behaves in reaction to available data. "Use journal abbreviation" is one of the default options Zotero offers in the export dialog, although exporters can choose to hide it. In the context of BBT (and other exporters that leave it visible), it means "Use journal abbreviation instead of journal title". If you have this off, the abbrev will be used as per spec; for BibTeX, this means "don't use it", for BibLaTeX, this means "put it in shortjournal".
To summarize: "Use journal abbreviation" affects BBTs behavior; "Auto-abbrev" affects what data is available to that behavior.
It is wholly possible to want Auto-Abbrev to be on, but not "Use abbrev instead of title" (as a matter of fact, it's what I usually have). This would be impossible in the scenario where the two are collapsed into one.
It may initially look like there are 4 scenarios:
(context: "abbrev available" means an abbreviation was entered manually, or alternately, if "auto-abbrev" is on, one was successfully generated. If no abbrev was entered manually, and "auto-abbrev" is off _or_ Zotero didn't generate an abbrev when I asked it, no abbrev is available):
In both BBT and BBLT, the full journal title will be exported, and nothing else.
In both BBT and BBLT, the full journal title will be exported. As BibTeX has no field for abbreviations, nothing more is done. In the case of BibLaTeX, the abbreviation will be put in the shortjournal field.
In both BBT and BBLT, the full journal title will be exported, and nothing else
In both BBT and BBLT, the abbrev will be put where the full title would normally end up, and nothing more is done
But these scenarios are just examples of the more general behavior (in pseudo-code):
if "auto-abbrev" is on and reference.abbrev is empty
reference.abbrev = auto-generated-abbrev
if "use abbrev" is on and reference.abbrev is not empty
reference.full-journal-title = reference.abbrev
make reference.abbrev empty
if reference.full-journal-title is not empty
output reference.full-journal-title
if exporting for biblatex and reference.abbrev is not empty
output reference.abbrev
To match this to your descriptions, in the quick-copy case the behavior you describe is indeed what you see, because "use abbrev" is off. The behavior you describe under "normal export" matches too (I think), but reads more chaotically because it looks to me like you see "auto-abbrev" as the most important of the two that affects behavior, where it is in fact _only_ "use abbrev" that affects behavior.
@thomas-muench, any ideas?
Closing for lack of activity
Sorry for getting back old issue. I have similar problem. Whatever I try I cannot force quick export (ctrl+shift+c) to abbreviate journal names with bibtex. Is there any way to force it?
You need to enable the setting in the prefs. If it doesn't work, please open a new issue -- this issue is pretty old and relates to the Z4 version of BBT.
Thanks for the reply. Before I open new issue quick check: where and what option I should set in preferences? I use pre-release v5.0.21 with Zotero 5.0.18.
I had forgotten I had removed the preference while abbrevs didn't work. 5.0.22 will have the pref back; it should drop in 10 minutes or so.
Zotero is at 5.0.19 at this moment BTW; you're free to use 5.0.18 of course, but I only test against the latest release, so before opening new issues, please do upgrade.
For reference if anyone comes across this issue:
A workaround to get journal abbreviations with Better BibTeX quick-copy is to edit Zotero\translators\Better BibTeX.js and set "useJournalAbbreviation" to true.
Which will get overwritten the next time BBT updates.
Is there any chance we could get this feature into BBT so that we don't have to use the workaround suggested by @stroitzsch?
In what way would you envision this feauture? I've outlined the problems with making the default true (which, given what it does, I'm not going to make the default).
I see this more as a Zotero feature. I don't currently see a non-confusing way that I could do this, UI-wise. If Zotero would have some UI where you could change the defaults per translator, BBT would not even know about it and do the right thing. But if the request is "will you make use Journal abbrev the default for the BBT translators", the answer is "no".
Thank you for the answer @retorquere. I cross-referenced this issue with an issue in Zotero's github account.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.