typst / webapp-issues

Issue tracker for Typst's web app.
https://typst.app
12 stars 0 forks source link

Zotero Sync: duplicate item keys #386

Closed DerLeole closed 3 months ago

DerLeole commented 3 months ago

Description

Overview

I am using typst.app pro and linked my zotero account to typst to sync a .bib file from my project. When items have the same author, date, and first word of the title, the autogenerated key for them would be the same. To fix this, numbers are added at the end for otherwise duplicate keys. The file created by the typst.app zotero sync however seems to randomly reset or forget this enumeration, leading to duplicate keys. This is not the case when the zotero app is used to generate a biblatex file manually.

Details

Recently I added a lot of new sources quickly, some of which did not have much more than a title and a link. The title of all these webpages also started with the same word ("View" in this case"). As there is no author and no date present, the autogenerated biblatex item key was noauthor-view-nodate. Since there were multiple entries in zotero, the autogeneration correctly appends numbers at the back, eg noauthor-view-nodate-5. This worked perfectly in the synced file in typst until I took a break and then added more sources. These newly added sources seem to not adhere to the exisitng enumeration of the existing keys, with some having names like noauthor-view-nodate-1, even when such a key already exists in the document. The order of the documents/keys is also not the same as when the zotero app is used for a manual export.

It almost seems like typst.app does some caching or similar and only converts new entries, but forgets to check for duplicate keys in previously converted material, but thats just a guess.

Example

biblatex file generated by typst.app:

@online{noauthor_view_nodate,
    title = {View of A Model for Balancing Clarity and Appeal in Serious Game Visuals},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1633/1620},
    urldate = {2024-06-26},
}

@online{noauthor_view_nodate-1,
    title = {View of Adaptability and Procedural Content Generation for Educational Escape Rooms},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/618/756},
    urldate = {2024-06-26},
}

@online{noauthor_view_nodate-2,
    title = {View of Combine {DGBL} with {AI} system: A Technical Guidance to Reduce Teacher’ s Burden in Digital Game-based Learning},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1892/1718},
    urldate = {2024-06-26},
}

@online{noauthor_view_nodate-3,
    title = {View of Designing Educational Escape Rooms with Generative {AI}: A Framework and {ChatGPT} Prompt Engineering Guide},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1870/1636},
    urldate = {2024-06-26},
}

@online{noauthor_view_nodate-4,
    title = {View of Development of an Enjoyable Educational Game on Fundamental Programming: Designing for Inclusion and Learning Analytics},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1909/1665},
    urldate = {2024-06-26},
}

@online{noauthor_view_nodate-5,
    title = {View of Exploring In-Game Scaffolds for Higher-Order Learning in a Case-Based {RPG} Learning Game},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1590/1679},
    urldate = {2024-06-26},
}

@online{noauthor_view_nodate-6,
    title = {View of Gamification in Cybersecurity Education: The {RAD}-{SIM} Framework for Effective Learning},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/504/732},
    urldate = {2024-06-26},
}

@online{noauthor_view_nodate-7,
    title = {View of Literature Review for the Design Methods of Serious Games},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1328/1638},
    urldate = {2024-06-26},
}

@online{noauthor_view_nodate-8,
    title = {View of Need-Based Game Design: Developing a {CT} Game Based on Educational Needs},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1489/1646},
    urldate = {2024-06-26},
}

@online{noauthor_view_nodate,
    title = {View of Serious games as innovative formative assessment tools for programming in Higher Education},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/756/697},
    urldate = {2024-06-26},
}

@online{noauthor_view_nodate-1,
    title = {View of Using In-game Analytics to Explore Learning Dynamics of Information Literacy in a Social Media Simulator},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1464/1696},
    urldate = {2024-06-26},
}

@online{noauthor_view_nodate-2,
    title = {View of When design gets in the way: student learning and digital escape game},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1406/1630},
    urldate = {2024-06-26},
}

biblatex file generated by zotero app

@online{noauthor_view_nodate,
    title = {View of Adaptability and Procedural Content Generation for Educational Escape Rooms},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/618/756},
    urldate = {2024-06-26},
    file = {View of Adaptability and Procedural Content Generation for Educational Escape Rooms:C\:\\Users\\Leo\\Zotero\\storage\\Z2BG2B9I\\756.html:text/html},
}

@online{noauthor_view_nodate-1,
    title = {View of Gamification in Cybersecurity Education: The {RAD}-{SIM} Framework for Effective Learning},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/504/732},
    urldate = {2024-06-26},
    file = {View of Gamification in Cybersecurity Education\: The RAD-SIM Framework for Effective Learning:C\:\\Users\\Leo\\Zotero\\storage\\3DKPVKKQ\\732.html:text/html},
}

@online{noauthor_view_nodate-2,
    title = {View of Serious games as innovative formative assessment tools for programming in Higher Education},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/756/697},
    urldate = {2024-06-26},
    file = {View of Serious games as innovative formative assessment tools for programming in Higher Education:C\:\\Users\\Leo\\Zotero\\storage\\WJF2NK4V\\697.html:text/html},
}

@online{noauthor_view_nodate-3,
    title = {View of Combine {DGBL} with {AI} system: A Technical Guidance to Reduce Teacher’ s Burden in Digital Game-based Learning},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1892/1718},
    urldate = {2024-06-26},
    file = {View of Combine DGBL with AI system\: A Technical Guidance to Reduce Teacher’ s Burden in Digital Game-based Learning:C\:\\Users\\Leo\\Zotero\\storage\\EAEAS86M\\1718.html:text/html},
}

@online{noauthor_view_nodate-4,
    title = {View of Using In-game Analytics to Explore Learning Dynamics of Information Literacy in a Social Media Simulator},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1464/1696},
    urldate = {2024-06-26},
    file = {View of Using In-game Analytics to Explore Learning Dynamics of Information Literacy in a Social Media Simulator:C\:\\Users\\Leo\\Zotero\\storage\\7PRJTIYW\\1696.html:text/html},
}

@online{noauthor_view_nodate-5,
    title = {View of Exploring In-Game Scaffolds for Higher-Order Learning in a Case-Based {RPG} Learning Game},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1590/1679},
    urldate = {2024-06-26},
    file = {View of Exploring In-Game Scaffolds for Higher-Order Learning in a Case-Based RPG Learning Game:C\:\\Users\\Leo\\Zotero\\storage\\CSJMTBVL\\1679.html:text/html},
}

@online{noauthor_view_nodate-6,
    title = {View of Development of an Enjoyable Educational Game on Fundamental Programming: Designing for Inclusion and Learning Analytics},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1909/1665},
    urldate = {2024-06-26},
    file = {View of Development of an Enjoyable Educational Game on Fundamental Programming\: Designing for Inclusion and Learning Analytics:C\:\\Users\\Leo\\Zotero\\storage\\HB8KG4BR\\1665.html:text/html},
}

@online{noauthor_view_nodate-7,
    title = {View of Need-Based Game Design: Developing a {CT} Game Based on Educational Needs},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1489/1646},
    urldate = {2024-06-26},
    file = {View of Need-Based Game Design\: Developing a CT Game Based on Educational Needs:C\:\\Users\\Leo\\Zotero\\storage\\GJ345UXX\\1646.html:text/html},
}

@online{noauthor_view_nodate-8,
    title = {View of Literature Review for the Design Methods of Serious Games},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1328/1638},
    urldate = {2024-06-26},
    file = {View of Literature Review for the Design Methods of Serious Games:C\:\\Users\\Leo\\Zotero\\storage\\WCGJ9AU7\\1638.html:text/html},
}

@online{noauthor_view_nodate-9,
    title = {View of Designing Educational Escape Rooms with Generative {AI}: A Framework and {ChatGPT} Prompt Engineering Guide},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1870/1636},
    urldate = {2024-06-26},
    file = {View of Designing Educational Escape Rooms with Generative AI\: A Framework and ChatGPT Prompt Engineering Guide:C\:\\Users\\Leo\\Zotero\\storage\\3JGB4K53\\1636.html:text/html},
}

@online{noauthor_view_nodate-10,
    title = {View of When design gets in the way: student learning and digital escape game},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1406/1630},
    urldate = {2024-06-26},
    file = {View of When design gets in the way\: student learning and digital escape game:C\:\\Users\\Leo\\Zotero\\storage\\PF3QVBWW\\1630.html:text/html},
}

@online{noauthor_view_nodate-11,
    title = {View of A Model for Balancing Clarity and Appeal in Serious Game Visuals},
    url = {https://papers.academic-conferences.org/index.php/ecgbl/article/view/1633/1620},
    urldate = {2024-06-26},
    file = {View of A Model for Balancing Clarity and Appeal in Serious Game Visuals:C\:\\Users\\Leo\\Zotero\\storage\\4BAAU6PH\\1620.html:text/html},
}

Reproduction URL

No response

Browsers

Firefox

OS

Windows

reknih commented 3 months ago

Hey there,

The problem here is that we must request large bibliographies in parts from Zotero. Zotero does only disambiguate citation keys in the same part, but not if the two references are spread across different parts. This is why this problem appears spuriously – it depends on how the data is returned, how long the bibliography is, et cetera. We are increasing the lengths of these parts from 50 to the maximum of 100 to have this problem appear less. However, we cannot fully circumvent it at the moment, and Overleaf’s Zotero sync feature is experiencing similar difficulties (see https://forums.zotero.org/discussion/103606/ambiguous-citekeys). The problem does not occur locally because Zotero processes all keys simultaneously during local export.

However, you can instruct Zotero to always use a specific (disambiguated) cite key by installing the add-on „Better BibTeX for Zotero“ from https://retorque.re/zotero-better-bibtex/. This will add autogenerated, unambiguous keys to all your items that are synchronized to Typst, independently from in which part the reference occurs.

We apologize for the inconvenience and hope you are otherwise enjoying Typst Pro so far. Please tell me if you have trouble installing the Zotero add-on.

DerLeole commented 3 months ago

Ah, that makes sense.

Thanks for the effort, and the addon seems like a decent workaround for now!