-
Notifications
You must be signed in to change notification settings - Fork 852
BibTeX: round-trip citation keys. #3537
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
base: master
Are you sure you want to change the base?
Conversation
a6921f2 to
d0adf35
Compare
|
If anyone wants some context: I'm motivated by trying to migrate my existing project into Typst. I've set up syncing and replaced my bibliography.bib with the synced zotero.bib, but all my references are broken! The forums turned me onto the By the way, Scaffold auto-formatted everything and it looks like the formatter hasn't been run on this file in ages; other than my patch here: I didn't commit them because I thought that would have been toooo much. But maybe that would be something to do in a follow-up? Except it made the linter fail :/ ? I fixed the linting errors in #3538. Except for that Scaffold was SUPER easy to use. I spent a while grepping to get oriented but once I knew to look for the word "translator" I got this done in a snap. I thought it would take me weeks of picking at it and I would never get it done, but there's a full IDE built in for working on these. I'm really impressed. |
|
Can someone tell me why the tests say ?
I only touched one file. It looks like maybe CI needs some attention? What should I do, mark this skip-ci? |
|
I'll leave this for @AbeJellinek to decide, but I'd assume Zotero won't take this: the BibTeX translator is not intended for roundtripping and the BetterBibTeX add-on already provides this functionality (and is recommended for people who want to use Zotero while writing in LaTeX or related languages). The CI runs on multiple translators because lots of other translators rely on the BibTeX translator -- that's also a reason why forcing original citekeys on import isn't necessarily desirable: it'd get you the citekeys used (somewhat randomly) on whatever site you're importing from. (edit: and this includes people who are not using citekeys at all and would likely be rather confused by their appearance in Extra) |
|
Thanks for the explanation 🦢 . I wasn't sure how much attention this repo had gotten lately so I'm happy to have the feedback already 😊 So, in case case, I shouldn't have used the Import button? I followed the path of least resistance and let me be clear, it worked 99% and I'm very happy to be able to collab with my team and sort through 200 references without going mad. It's all good so far except that now I have to go and rewrite 20 pages of citations and rename my local PDF collection; and I know Zotero can manage PDFs but I want to keep copies with my projects (Zotero seems very nice and all! No shade! But it's still Someone Else's Computer and I won't trust the longevity of my projects to any such thing). I see why scraping .bib from the web could be surprising for users, but if I'm importing my file that I've curated I want my citekeys to survive. What if I stored to I really hope we can get this working. Zotero + Typst could be like 🤜🤛💪. They're already pretty good together, and this smooths the migration for anyone who wants write better. |
|
The point is that you can just install the BBT add-on in Zotero and it will import with citekey because it's intended exactly for your use case (the plugin is mentioned in the thread you link to -- I don't quite understand the limitation they mention. Zotero's API BibTeX will pick up citekeys stored in |
|
I didn't realize BBT will generate "extra: Citation Key:" entries. That's not mentioned in the thread or the BBT site. It's a twisty series of steps for something pretty basic. I tried to run the tests locally to avoid the CI timeout; I got as far as having selenium pop open but I saw a bunch of content-security errors so I wasn't actually able to test. And I tried Anyway, I have a good hope that this is not really disruptive and only improves things going forward. I'm looking forward to seeing Abe's take. Another approach exposes |
Imported .bib keys were being replaced by citeKeyFormat = "%a_%t_%y"; Preserve them so users can sync pre-existing LaTeX projects with Zotero.
d0adf35 to
a8a645d
Compare
|
|
||
| if (item.itemID) { | ||
| item._extraFields.push({ field: "citation key", value: item.itemID }); | ||
| //item.citationKey = item.itemID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this is a bug that maybe someone wants to look into but .citationKey doesn't seem to get saved to the database, or even exported to the output in the tests, which is odd because doExport() references it.
Imported .bib keys were being replaced by citeKeyFormat = "%a_%t_%y"; Preserve them so users can sync pre-existing LaTeX/Typst projects with Zotero.