BibTeX Plugin: DevLog[7]

Week 7 (zero-based) has arrived :smiley:

Last week, not much was accomplished actually (just enabling the user to import data from multiple .bib files), so I didn't bother releasing a new version for just that. On the other hand, this week we have a very useful feature and a lot of work to be done. Namely, as requested by most users in the survey, I'm gonna work on adding an option for users to specify the citation style in which references are rendered at the bottom of the note. I'm very excited about this feature because I get to learn a lot of stuff both engineering- and research-wise.

Wish me luck :heart:

5 Likes

3 posts were split to a new topic: Custom Citation Style - Spec

Version 0.5.0 is out :smiley: :rocket:

New Features

  • Add support for custom bibliography styles
  • Add support for Importing multiple .bib files
  • Add Description under the CSL and BibTeX fields in the config screen

Bug Fixes

  • The year of publication appears as -1 in some references

Github Repo
Trello Board

I have a problem because the references are not showing up at all after the update. I added Nature.csl file from the Zotero style repository (link). Any idea what went wrong? Thank you for the help and all the work. :smiley:

I think that's because after updating any plugin, the settings values are lost. So, you will need to again insert the paths of the .bib files?

I have added the .bib file as well, but still no references. I also changed to different .csl form Zotero but still no luck.
I got prompted for an error when path to the .bib file was not added or it was incorrect. (Error: Could not open some files: ENOENT: no such file or directory, open").

Can you open the development tools and send a screenshot of the logs?
You can open it by Help -> Toggle Development Tools

I found error in under Development Tools -> Console with Filter bib:

/tmp/.mount_JoplinnvOdFx/resources/app.asar/node_modules/@joplin/lib/Logger.js:188 13:39:07: PluginService: Loading plugin from /home/zakky/.config/joplin-desktop/cache/com.xUser5000.bibtex
/tmp/.mount_JoplinnvOdFx/resources/app.asar/node_modules/@joplin/lib/Logger.js:188 13:39:08: joplin.plugins: Starting plugin: com.xUser5000.bibtex
/tmp/.mount_JoplinnvOdFx/resources/app.asar/node_modules/@joplin/lib/Logger.js:188 13:39:09: joplin.plugins: Finished running onStart handler: com.xUser5000.bibtex (Took 1092ms)
index.html:1 Uncaught (in promise) Error: Reference not found
    at Function.getReferenceById (/home/zakky/.config/joplin-desktop/tmp/plugin_com.xUser5000.bibtex.js:1)
    at Object.retrieveItem (/home/zakky/.config/joplin-desktop/tmp/plugin_com.xUser5000.bibtex.js:1)
    at h.Engine.retrieveItem (/home/zakky/.config/joplin-desktop/tmp/plugin_com.xUser5000.bibtex.js:1)
    at h.Registry.doinserts (/home/zakky/.config/joplin-desktop/tmp/plugin_com.xUser5000.bibtex.js:1)
    at h.Engine.updateItems (/home/zakky/.config/joplin-desktop/tmp/plugin_com.xUser5000.bibtex.js:1)
    at u.formatRefs (/home/zakky/.config/joplin-desktop/tmp/plugin_com.xUser5000.bibtex.js:1)
    at /home/zakky/.config/joplin-desktop/tmp/plugin_com.xUser5000.bibtex.js:1
    at EventEmitter.<anonymous> (services/plugins/plugin_index.js:92)
    at EventEmitter.emit (events.js:310)
    at Object.onMessage (electron/js2c/renderer_init.js:91)
index.html:1 Uncaught (in promise) Error: Reference not found
    at Function.getReferenceById (/home/zakky/.config/joplin-desktop/tmp/plugin_com.xUser5000.bibtex.js:1)
    at Object.retrieveItem (/home/zakky/.config/joplin-desktop/tmp/plugin_com.xUser5000.bibtex.js:1)
    at h.Engine.retrieveItem (/home/zakky/.config/joplin-desktop/tmp/plugin_com.xUser5000.bibtex.js:1)
    at h.Registry.doinserts (/home/zakky/.config/joplin-desktop/tmp/plugin_com.xUser5000.bibtex.js:1)
    at h.Engine.updateItems (/home/zakky/.config/joplin-desktop/tmp/plugin_com.xUser5000.bibtex.js:1)
    at u.formatRefs (/home/zakky/.config/joplin-desktop/tmp/plugin_com.xUser5000.bibtex.js:1)
    at /home/zakky/.config/joplin-desktop/tmp/plugin_com.xUser5000.bibtex.js:1
    at EventEmitter.<anonymous> (services/plugins/plugin_index.js:92)
    at EventEmitter.emit (events.js:310)
    at Object.onMessage (electron/js2c/renderer_init.js:91)

Is this enough can I send you anything else that might help you?

Awesome job!

1 Like

I tried a bunch of things to try and produce this bug on my machine but no luck at all. I don't know why this shows up. Anyway, I'll keep searching and tell you about any updates.

I have tested (Win10 and Linux) a few more things and managed to make it work (nature.csl now works but I don't know why yesterday hasn't) and those are my two conclusions:

  1. not all styles are working (the reference section those not show up at all):

    • medicinal-chemistry-research - not working
    • medicinal-research-reviews - works
    • process-biochemistry - not working
    • royal-society-of-chemistry - works
    • apa7th - works
    • nature - works
    • european-journal-of-medicinal-chemistry - not working
    • international-journal-of-molecular-sciences - not working
    • journal-of-medicinal-chemistry - not working
    • journal-of-the-american-chemical-society - not working
    • acs-medicinal-chemistry-letters - not working

    Maybe there is some problem with styles that have special numbering (like [1], (1)).

  2. Numbers for numbering references are in a separate line instead of on the same line as a reference (just in front of it).

1 Like

Does it show any error in the console when a citation style is not working? How to enable debugging | Joplin

1 Like

Could you please provide CSL links for the mentioned styles? I can't find some of them online.

Regarding the issue of the numbers, I'll look into that.

@laurent @xUser5000 I think I found the problem why some .csl citation style files have errors rendering the references. I got all the citation styles from here Zotero Style Repository. The one that are not working doesn't contain the macro code for styling the references (I not sure how Zotero is still able to render them). Have a lot at Medicinal chemistry research compared to the Medicinal research reviews. I made a mistake and assumed that if the citation style is in the Zotero Style Repository it will work.

If this is not what causes the problem I'll try with debugging (I don't have a lot of knowledge about coding but I'll do my best and ask for guidance if I'll need it).
Thank you for the help and all the great work!

2 Likes

Yesterday, I tried all along to solve this issue and even contacted the maintainer of the library that I'm using to do citations, but no luck at all. I'll try once again today while writing the spec of the new feature.

Brand new Joplin user so please forgive me if I am in the wrong thread.

I just installed the BibTex Plugin. When I try to insert a citation, Joplin seems to open something abnd says

Select some references to be added to the current note

but all I see is an otherwise blank screen. No error messages. I get the same result if I open an empty file. Weird.

The BibTeX file works in another application.

Joplin for Desktop
Joplin 2.1.9
Ubuntu 21.04

Any suggestions? Thanks

@xUser5000 I hope that you are ok. :slight_smile:
May I ask how is the state of this plugin? I was also wondering if it would be possible to maybe add option to render the references as a side panel like in the plugin Automatic Backlinks to note. Maybe you could borrow the code used there?