jkitchin / scimax

An emacs starterkit for scientists and engineers
Other
1.03k stars 123 forks source link

Advice on using zotero and org-ref #347

Closed shrysr closed 4 years ago

shrysr commented 4 years ago

I'm finding zotero convenient to quickly store an article/paper and using the zotero-better-bibtex extension, I can auto-export to a specified bibfile. This bib file being referenced by org-ref enables me to cite articles in Emacs using org-ref instead of using other tools.

However, there is no automatic import feature into zotero. If I add a bib entry using org-ref the only option appears to be a complete re-import in Zotero. This still seems to preserve downloaded PDF's and other information in Zotero (thankfully), but creates a new collection each time.

The goal here is to use proper and consistent referencing for blog posts, zettels or any formal document I publish. For example, depending on what I am working on - a good number of references for a blog post could be online articles, instead of published papers.

Zotero is apparently convenient for a quick capture of a bib entry from a browser. Before today, I was using an add-on that generated bibtex entries and manually inserting them into my bib file.

I would be grateful for advice and ideas, and am curious to know how you generally manage your references and related notes on each entry. For example, notes taken in Zotero can be exported, but I do not think org-ref's notes in an org file would get imported into Zotero.

shrysr commented 4 years ago

Perhaps the smart way is to capture most information via Zotero since convenient, and maintain a separate bib file for entries created via org-ref? I guess, the DOI/ISBN etc are often obtained from the browser first, unless I am using eww in Emacs.

I see a quick copy option with the org-ref format in the zotero-better-bibtex extension. Maybe another option is to use this for entries created with org-ref ?

jkitchin commented 4 years ago

I basically only use org-ref. For a website, you can use org-ref-url-html-to-bibtex (in org-ref-url-utils) to generate a bibtex entry. For example, copy the url this page to the clipboard, then run that command and it adds this entry:

@misc{nil-2020-advic-issue-github, author = {nil}, howpublished = {https://github.com/jkitchin/scimax/issues/347}, note = {Online; accessed 08 March 2020}, title = {Advice on using zotero and org-ref · Issue #347 · jkitchin/scimax · GitHub}, year = 2020, }

If you have a doi, probably org-ref can capture it (there are some unsupported types, but they are unsupported because I don't come across them often). ISBN can also usually be captured.

shrysr commented 4 years ago

AH! I missed org-ref-url-html-to-bibtex and the url utils! (even though my first step was to project-grep scimax since I was convinced that this was available! I can't see how I missed it now). This is great.

I have happily bid adieu to Zotero. FWIW: zotero did import the bib file I had via org-ref fine, but then the automatic export also changes the key formatting unless explicitly set. I was in danger of needing to redo existing citations and it was proving troublesome.

Indeed, the ISBN/doi functions have worked well for the papers and the books that I've been taking notes from. org-ref combined with org-brain have significantly enhanced my efficiency in assimilating my reading into notes. I've been experimenting with adding org-download, org-web-tools to this mix and the results have surpassed my expectations over the last few months. I think these probably give me almost all I need for focused study and publishing as required. I'm hoping to extend scimax's functions and hydras for something generic once the workflow is more mature.

One additional question: is the arxiv lookup designed to produce limited search results? Or am I using it incorrectly? (I saw for example there is a arxiv-mode for 'browsing' arxiv though I'm yet to try it).

randomwangran commented 4 years ago

I've tested org-ref-url-html-to-bibtex, really cool.

@misc{nil20_advic_issue_github,
  author =       {nil},
  howpublished = {https://github.com/jkitchin/scimax/issues/347},
  note =         {Online; accessed 08 March 2020},
  title =        {Advice on using zotero and org-ref · Issue #347 ·
                  jkitchin/scimax · GitHub},
  year =         2020,
}

However, I catched an issue: @jkitchin

if you put this url into your kill-ring:

https://aip.scitation.org/doi/10.1063/1.5140981

You get:

@misc{nilil,
  author =       {nil},
  howpublished = {https://aip.scitation.org/doi/10.1063/1.5140981 },
  note =         {Online; accessed 08 March 2020},
  year =         {nil},
}

not

@article{doi:10.1063/1.5140981,
author = {Yang,Songzhi (杨松枝) and Habchi,Chaouki },
title = {Real-fluid phase transition in cavitation modeling considering dissolved non-condensable gas},
journal = {Physics of Fluids},
volume = {32},
number = {3},
pages = {032102},
year = {2020},
doi = {10.1063/1.5140981},

URL = { 
        https://doi.org/10.1063/1.5140981

},
eprint = { 
        https://doi.org/10.1063/1.5140981

}

}

Not sure how to walk around this.

Agree, with you @shrysr. found these packages useful:

shrysr commented 4 years ago

@randomwangran - I guess the doi-utils route is more reliable when you do have a doi rather than URL. I was able to add the correct bibtex entry for that cavitation modeling paper using doi-utils-add-bibtex-entry-from-doi. I think grabbing the correct bibtex entry from the URL is quite dependent on the HTML markup of the webpage and it is probably difficult to achieve consistently.

jkitchin commented 4 years ago

DOIs are usually more reliable. Getting anything from a url is much less reliable; it is not always possible to grab the right doi from a url, and the html is usually not well structured. At least with a doi, we always get json data from the same source. org-ref handles most of the json that comes back, but there are a few types it doesn't know about yet, things like conference proceedings, etc.

randomwangran commented 4 years ago

For some reasons, I cannot call doi-utils-add-bibtex-entry-from-doi properly.

After I send a doi: 10.1063/1.5140981 to the kill-ring, then call

doi-utils-add-bibtex-entry-from-doi

I get an error:

org-ref-possible-bibfiles: Wrong type argument: listp, "~/Dropbox/myPdfLib/lib.bib"

I will study this issue.

I currently using Mendeley to collect bib, I will try Zotero someday in the future. I think these software are good at doing what we want rightnow

jkitchin commented 4 years ago

That probably means you have org-ref-default-bibliography set to a string, and not a list. It should be set to '("~/Dropbox/myPdfLib/lib.bib").

randomwangran commented 4 years ago

@jkitchin

Life saver. Thanks.

Regetting using 3rd software for such a long time.

Not even has courage to report such a tiny error.

jkitchin commented 4 years ago

I've tested org-ref-url-html-to-bibtex, really cool.

@misc{nil20_advic_issue_github,
  author =       {nil},
  howpublished = {https://github.com/jkitchin/scimax/issues/347},
  note =         {Online; accessed 08 March 2020},
  title =        {Advice on using zotero and org-ref · Issue #347 ·
                  jkitchin/scimax · GitHub},
  year =         2020,
}

However, I catched an issue: @jkitchin

if you put this url into your kill-ring:

https://aip.scitation.org/doi/10.1063/1.5140981

You get:

@misc{nilil,
  author =       {nil},
  howpublished = {https://aip.scitation.org/doi/10.1063/1.5140981 },
  note =         {Online; accessed 08 March 2020},
  year =         {nil},
}

not

@article{doi:10.1063/1.5140981,
author = {Yang,Songzhi (杨松枝) and Habchi,Chaouki },
title = {Real-fluid phase transition in cavitation modeling considering dissolved non-condensable gas},
journal = {Physics of Fluids},
volume = {32},
number = {3},
pages = {032102},
year = {2020},
doi = {10.1063/1.5140981},

URL = { 
        https://doi.org/10.1063/1.5140981

},
eprint = { 
        https://doi.org/10.1063/1.5140981

}

}

Not sure how to walk around this.

Agree, with you @shrysr. found these packages useful:

  • org-ref
  • org-brain
  • org-download
  • org-web-tool
  • org-agenda
  • org-capture
  • org-noter
  • org-pdftools

@randomwangran If you have a doi you should use that instead of a url to the article. The url is always less reliable, because org-ref has to get the html for the page, and try to find a doi in it. This is not easy to do reliably for a lot of reasons including: doi's do not have an easy to match regexp (org-ref matches a lot but not all of them), and there can be many dois in an html page (from references for example).