-
Notifications
You must be signed in to change notification settings - Fork 74
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
Can support for BibDesk be added to bibtex-completion? #396
Comments
Hmm. The link above doesn't seem to work for me if I click on it, but if I cut and paste the text into a browser it works fine. |
Hi, thanks for creating this issue. In principle I would like to support all the different ways to reference PDFs. But some bibliography managers make this more difficult than necessary, some likely intentionally to lock in users. Although that's probably not the case with BibDesk which is libre software. Anyway, the solution is to create a plugin system for Bibtex completion where the user configures the linking style used in their bibliography and then the appropriate plugin is used (could be multiple plugins for messy bibliographies). We can't try all linking styles because there are too many and it would slow down parsing too much. If anyone is interested in working on such a plug-in system, I would be happy to provide guidance. It's actually not too difficult and such a system would close a lot of other issues as well. I would like to work on this myself, but I probably won't find the time in the near future. |
It looks like we could almost do it by just setting bibtex-completion-pdf-field to "bdsk-file-1”. However, the field contents need to be base64 decoded to obtain the file name + directory.
An example is
bdsk-file-1 = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxAuLi4vLi4vLi4vLi4vLi4vRG9jdW1lbnRzL1BhcGVycy9BZGFtcy8xOTk0LnBkZk8RAUoAAAAAAUoAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAAAAAAABCRAAB/////wgxOTk0LnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAUABAAACiBjdQAAAAAAAAAAAAAAAAAFQWRhbXMAAAIALy86VXNlcnM6c3RhbnRvbjpEb2N1bWVudHM6UGFwZXJzOkFkYW1zOjE5OTQucGRmAAAOABIACAAxADkAOQA0AC4AcABkAGYADwAaAAwATQBhAGMAaQBuAHQAbwBzAGgAIABIAEQAEgAtVXNlcnMvc3RhbnRvbi9Eb2N1bWVudHMvUGFwZXJzL0FkYW1zLzE5OTQucGRmAAATAAEvAAAVAAIADv//AAAACAANABoAJABVAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAaM=}
If I put the contents of the field into file test.txt, then run
base64 -d test.txt | plutil -convert xml1 -o - -
I get the output
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aliasData</key>
<data>
AAAAAAFKAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAAAAAAAAQkQAAf////8I
MTk5NC5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAFAAQAAAogY3UAAAAAAAAAAAAAAAAA
BUFkYW1zAAACAC8vOlVzZXJzOnN0YW50b246RG9jdW1lbnRzOlBhcGVyczpBZGFtczox
OTk0LnBkZgAADgASAAgAMQA5ADkANAAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8A
cwBoACAASABEABIALVVzZXJzL3N0YW50b24vRG9jdW1lbnRzL1BhcGVycy9BZGFtcy8x
OTk0LnBkZgAAEwABLwAAFQACAA7//wAA
</data>
<key>relativePath</key>
<string>../../../../../Documents/Papers/Adams/1994.pdf</string>
</dict>
</plist>
… On Nov 18, 2021, at 12:33 AM, Titus von der Malsburg ***@***.***> wrote:
Hi, thanks for creating this issue. In principle I would like to support all the different ways to reference PDFs. But some bibliography managers make this more difficult than necessary, some likely intentionally to lock in users. Although that's probably not the case with BibDesk which is libre software.
Anyway, the solution is to create a plugin system for Bibtex completion where the user configures the linking style used in their bibliography and then the appropriate plugin is used (could be multiple plugins for messy bibliographies). We can't try all linking styles because there are too many and it would slow down parsing too much.
If anyone is interested in working on such a plug-in system, I would be happy to provide guidance. It's actually not too difficult and such a system would close a lot of other issues as well. I would like to work on this myself, but I probably won't find the time in the near future.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#396 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAQNZDUMJYGQYFX7OQDTBDTUMS267ANCNFSM5IIJPAKQ>.
|
Yes, it's not super difficult to implement. But the current approach is to try all known formats (bare path, Mendeley/Zotero format). If we do this with the present format, we'd have to check every single entry even for people who are not even using BibDesk. Too expensive. |
Agreed. There should at least be a user-defined variable to tell bibtex-completion what to look for.
… On Nov 18, 2021, at 2:39 AM, Titus von der Malsburg ***@***.***> wrote:
Yes, it's not super difficult to implement. But the current approach is to try all known formats (bare path, Mendeley/Zotero format). If we do this with the present format, we'd have to check every single entry even for people who are not even using BibDesk. Too expensive.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I, like many other Mac users, use BibDesk to manage my bibliographies, and it would be very nice if bibtex-completion could find the PDF file for a given BibTeX entry using the bdsk-file-1 (or ...2 if there's more than one PDF file) entry that BibDesk puts into the bib file (which is a base64-encoded fully qualified path name).
This discussion came up a few years relative to org-ref. Below is a link to the discussion, which contains a solution that should be relatively easy to port over to bibtex-completion. Thanks!
jkitchin/org-ref#273
The text was updated successfully, but these errors were encountered: