0

This problem might be more pointed towards Zotero and the way it exports to .bib-files, but I'll try here either way.

I am writing a LaTeX document in Overleaf, with a group library in Zotero. The references are imported into Overleaf by using the external URL of the group library (Explained here), ending up as "references.bib" in Overleaf.

When referencing to an official website of some company, the written date is often not specified (leaving it blank), and today's date is entered into Zotero in the accessed-field.

The title of the document is often "COMPANYNAME blabla". So the command will look like: \cite{COMPANYNAME COMPANYNAME nodate}. When later adding another source from the same website (But a different article/page from the same company), the older one is therefore called "COMPANYNAME COMPANYNAME nodate-1", making previous footnotes refer to the newer one i.e. the wrong source.

How can I avoid this?

The packages/config I am using:

\bibliographystyle{IEEEtran}
\usepackage[backend = biber,    % Recommended backend for sorting bibliography
            %style = IEEEtran,    % Close to the 'Harvard' referencing style
            urldate = long,     % Long: 24th Mar. 1997 | Short: 24/03/1997
            maxcitenames = 2,   % Number of authors in cite before replaced with 'Author#1 et al.'
            ]{biblatex}
\addbibresource{references.bib}     % Adding our file containing the references

Example:

If I were to write a statement about a Lamborghini Aventador, i would do it like this:

"Aventador is a fast car\cite{lamborghini_lamborghini_nodate}."

When I later add a second source from Laborghini, in this example the Urus page, to Zotero, it will be called "lamborghini_lamborghini_nodate" in the references.bib file. The old aventador-source will be called "lamborghini_lamborghini_nodate-1".

This will result in the statement I wrote earlier (and referenced to the Aventador page) is now pointing to the wrong source (the Urus page).

These two examples in the references.bib file:

Example with Lamborghini.com

QualZy
  • 41
  • 1
    I am using Zotero too and export specific collections to a .bib file, that subsequently is used in a (Lua)LaTeX document using \addbibresource{refernces.bib}. My references are formatted correctly and without the issues you're describing. I use Better BibTeX to handle export and citation keys in Zotero, which probably circumvents the call to Zotero API. – alchemist Jan 30 '23 at 11:01
  • Did you have a look at the contents of the references.bib file? How is it constructed in terms of Biblatex labels? Does that look the same as the references in your Zotero library? When only websites are affected, take a careful look how those entries are done in Zotero, especially which fields are entered and which not. – alchemist Jan 30 '23 at 11:05
  • Afterthought: could it be that the way you import your group library into the Overleaf document forces Zotero's API to check on the websites included in the library, thereby updating / replacing the fields of those entries? – alchemist Jan 30 '23 at 11:08
  • My references are also formatted correctly in the document, the problem I am describing is more of a problem when writing and the sources getting a bit mixed up, so the in-text footnotes are pointing to the wrong source. In the example I added in the original post, there is a screenshot from the references.bib file. – QualZy Jan 30 '23 at 13:28
  • Ok. Your edit is much clearer on the issue at hand. Do the two examples you gave have the same citation key in your Zotero library as in the shown references.bib file? The way you describe it could mean Zotero is doing something odd when you enter another reference linking to the same website. – alchemist Jan 30 '23 at 14:38
  • I couldn't duplicate your issue using my Zotero installation. A new reference to the same website that already was in the library resulted in adding an a to the citation key. The older citation key wasn't affected. Now I do use the extension Better BibTeX in my Zotero. That allows me to change the citation key formula to auth.lower+year. You don't have an author nor a date field in your output. Would adding those to your entries have the same effect as I see in my library? – alchemist Jan 30 '23 at 15:23
  • The author is on the last line of each of the examples in the reference.bib file. As official websites often don't write who has written each page, and when they were written, the author will have to be the company, and the date will be blank. But the "date accessed" will be added - the field "URL date" in the references.bib. I am going to look into the Better BibTex extension - thanks for the tip :) – QualZy Jan 30 '23 at 17:56
  • That seemed to do the trick! On Better BibTex's website, the first point in the list of features is: "Automatically generate citation keys without key clashes! Generate citation keys that take into account existing keys in your library even when they are not part of the items you export. Prevent random breakage!"

    So it seems that it somewhat of a known problem :))

    – QualZy Jan 30 '23 at 18:12
  • Sorry @QualZy I did overlook the author field in your references. So did the Better BibTeX addon in Zotero do the trick in organising your citation keys and hence the correct referencing in Overleaf? – alchemist Jan 30 '23 at 22:29
  • It worked, ish. My original setup by importing the references.bib file directly into Overleaf by using Zotero's export link did not work. Better BibTex has an 'explanation' where one can export to a file and check the "Keep updated", which I saved to a cloud and imported into Overleaf with URL. This would work fine, but since I am writing this in a group project, it would make the others dependent on my Zotero to refresh the file in my cloud. Not ideal – QualZy Jan 31 '23 at 07:47
  • You're using a group library in Zotero. The only way others can access that library is by using Zotero too. So why not ask them to install Better BibTeX too? That would prevent data corruption in the library as well, since the co-workers are still using the default way of citation key handling. – alchemist Jan 31 '23 at 08:23
  • Everyone in the group is using Zotero. That was not the point in the comment. – QualZy Jan 31 '23 at 09:50

2 Answers2

3

Based upon @alchemist's help, I found a solution that works in this context.

Better BibTex does come a long way, as it introduces a better way of handling citation keys that take into account already existing keys. However, when importing the .bib file into Overleaf, the only formats available is BibTeX and BibLaTeX (and not Better BibTex / Better BibLaTeX).

I solved this by the use of Better BibTeX's automatic export. The exported file was saved in a Google Drive (In the Better BibLaTex format) with the "Keep updated"-option checked. The file was then imported into Overleaf by "Import via URL" by creating a direct download link from the Google Drive folder.

Since this was a group-project using a group library, to make it such that all of the members can refresh the library into Overleaf, all of the group members were given access to the Google Drive folder, and exported the .bib file the same way as mentioned previously. By using the same folder with the same filename for the .bib file, the .bib file is getting overwritten every time someone refreshes, and the URL-import into Overleaf will still be working.

QualZy
  • 41
0

One thing that struck me as odd, was the way you call upon the IEEE referencing style. According to this question How to use biblatex with IEEE bibtex style? the use of \bibliographystyle{IEEEtran} conflicts with biblatex.

The proper use of the IEEE-style should be to use the commented out line in your options: style=ieee, which should tell biblatex to load the package biblatex-ieee. You could also explicitly load that package when in doubt that it is loaded (or present in Overleaf).

The Zotero addon Better BibTeX specifically states that it will generate unique citation keys keeping existing keys intact. This addon thus prevents alterations in keys when adding comparable items to the Zotero library. The Better BibTeX addon can be found on https://retorque.re/zotero-better-bibtex/ as well as information about installing and using the addon.

alchemist
  • 1,761
  • Hmm, I might look into that. My problem is however not regarding an error-message or references missing, but to the "name" that is going into the \cite{}-command is changing when a similar source as an existing one is added. I updated the original question and added an example to make it clearer. – QualZy Jan 30 '23 at 13:23