# Citations with org-ref, ox-bibtext, zotxt - use? Differences?

**URL:** <https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215>\
**Category:** Troubleshooting\
**Created:** [May 29, 2020, 2:35am UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215 "2020-05-29T02:35:39Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![cobblepot](https://avatars.discourse-cdn.com/v4/letter/c/dec6dc/32.png) [@cobblepot](https://org-roam.discourse.group/u/cobblepot)\
**Post date:** [May 29, 2020, 2:35am UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/1 "2020-05-29T02:35:40Z")

</div>

It seems that most people trying to integrate citations into org-roam notes are using org-ref. Is anyone using the “ox-\*\*\*” family of packages for this? Is anyone using zotxt to integrate Emacs with Zotero directly? I would appreciate if anyone could help me understand whether these packages are just different approaches to the same functionality or whether they are actually doing fairly different things.

I know that org-ref can help create links from notes to sources in a reference database and can provide contextual information in the Emacs minibuffer when the cursor is on an org-mode link. Does it do other things that are important, such as for exporting documents to LaTex or .docx? How do ox-\*\*\* or zotxt do similar or different things? Thanks for any guidance here.

---

<div class="post-metadata">

**Author:** ![leekeifon](https://avatars.discourse-cdn.com/v4/letter/l/db5fbb/32.png) [@leekeifon](https://org-roam.discourse.group/u/leekeifon)\
**Post date:** [May 30, 2020, 4:30am UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/2 "2020-05-30T04:30:34Z")

</div>

If you would like to use org-roam to build up your note taking system, then I think Zotero can be considered as just a place for converting and collecting the citation information. After a while, you could export all the citations in Zotero to bibtex form and sync with org-ref(not that much work).

When writing papers, org-ref should provide formal links format. If not, some other packages will, as most of them use the bibtex format.

---

<div class="post-metadata">

**Author:** ![cobblepot](https://avatars.discourse-cdn.com/v4/letter/c/dec6dc/32.png) [@cobblepot](https://org-roam.discourse.group/u/cobblepot)\
**Post date:** [May 31, 2020, 10:22pm UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/3 "2020-05-31T22:22:19Z")

</div>

> [@leekeifon](#):
>
> If you would like to use org-roam to build up your note taking system, then I think Zotero can be considered as just a place for converting and collecting the citation information. After a while, you could export all the citations in Zotero to bibtex form and sync with org-ref(not that much work).

Thanks for your response. Although Zotero can be used just to create the Bibtex file, I’m also  
wondering how it can be used with zotxt to integrate with Emacs directly.

> [@leekeifon](#):
>
> When writing papers, org-ref should provide formal links format. If not, some other packages will, as most of them use the bibtex format.

I don’t understand what this means. Org-mode can format links itself. Does “writing papers” mean just editing, or are you talking about exporting to a document format? I know the various packages overlap somewhat; I’m trying to understand how they are different so I can choose one and explain the choice to others.

---

<div class="post-metadata">

**Author:** ![bruce](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@bruce](https://org-roam.discourse.group/u/bruce)\
**Post date:** [June 1, 2020, 9:54am UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/4 "2020-06-01T09:54:07Z")

</div>

> [@cobblepot](#):
>
> Is anyone using zotxt to integrate Emacs with Zotero directly? I would appreciate if anyone could help me understand whether these packages are just different approaches to the same functionality or whether they are actually doing fairly different things.

I’ve never used zotxt, but my understanding is it would be at least a partial alternative to using helm-bibtex or ivy-bibtex; finding and inserting citations and such.

In the former, you’re connecting directly to zotero, and in the latter, you’re using bibtex or biblatex files for the data source.

I use the latter, and generate biblatex entries using zotero and better bibtex.

You could install zotxt and see what you think of the two options?

> [@cobblepot](#):
>
> I know that org-ref can help create links from notes to sources in a reference database and can provide contextual information in the Emacs minibuffer when the cursor is on an org-mode link. Does it do other things that are important, such as for exporting documents to LaTex or .docx? How do ox-\*\*\* or zotxt do similar or different things? Thanks for any guidance here.

Note: on your first point here, I think if you did use zotxt, you’d lose that linking functionality.

The [manual](https://github.com/jkitchin/org-ref/blob/master/org-ref.org) has info on the export options.

From what I understand, it has good latex output (where it relies on bibtex to do the actual formatting), and less on other formats.

Note, though:

1. pandoc has support for org syntax, and full citation support, using the same CSL language as Zotero for citation styling; so you should be able to use that to process the org files to other output formats (docx, etc.)
2. native citation support is coming to org “soon”, and part of that discussion includes the possibility to add citeproc.el, which would mean out-of-box support for CSL, and therefore full citation formatting for all org export formats

---

<div class="post-metadata">

**Author:** ![mshevchuk](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mshevchuk](https://org-roam.discourse.group/u/mshevchuk)\
**Post date:** [June 2, 2020, 9:14am UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/5 "2020-06-02T09:14:29Z")

</div>

For me, the main problem with Zotero, Mendeley and similar software is that they do not use BibTeX as their native storage format. Consequently, there always pop up smaller and bigger problems such as citation key generation, field mapping and limited possibility to create custom fields. My current approach is actually the opposite: managing references in a program that works with BibTeX directly and then export a subset of citations _into_ Zotero or Mendeley whenever I need their word-processing connectors. JabRef seems to be capable of most things Zotero can do. Bibdesk is a good choice for Mac users.

---

<div class="post-metadata">

**Author:** ![bruce](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@bruce](https://org-roam.discourse.group/u/bruce)\
**Post date:** [June 2, 2020, 12:58pm UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/6 "2020-06-02T12:58:50Z")

</div>

The main features of zotero are one-click metadata extraction, notes and such, and integration with word processors.

With Better BibTeX, you also get good bibtex and biblatex support.

I edit my biblatex files directly, in emacs.

---

<div class="post-metadata">

**Author:** ![mshevchuk](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mshevchuk](https://org-roam.discourse.group/u/mshevchuk)\
**Post date:** [June 2, 2020, 6:56pm UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/7 "2020-06-02T18:56:25Z")

</div>

I used Zotero for quite a while - maybe 5 or 6 years - as my main literature database. There were several solutions for connecting Zotero to Emacs, like some custom Zotero links in Org-mode and another thing, perhaps zotxt.

Unfortunately, I coudn’t make it along my way with them. I heavily relied on Better BibLaTeX extension for Zotero and it could even insert Org-ref cite links into Emacs, as far as I remember, I had to tinker with javascript to have a customize exporter which would support my BibTeX keys. But after all, the biggest challenge for me was keeping two databases - Zotero and my master .bib in sync. All these exports, they really - I mean really, without a hassle, work one way. Maybe the things are different now.

So I eventually migrated to a single .bib database, first managed with JabRef, now with Bibdesk. Both programs are able to retrieve metadata in one click through DOI, so I’m fine with that. Whenever I need to insert references into Microsoft Word, I export those references to a separate dedicated .bib file and import it into Zotero.

I don’t say Zotero is bad or whatever, the question was about how one manages their references. So this is just my story of a 10 years long personal experience.

---

<div class="post-metadata">

**Author:** ![mshevchuk](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mshevchuk](https://org-roam.discourse.group/u/mshevchuk)\
**Post date:** [June 2, 2020, 7:45pm UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/8 "2020-06-02T19:45:01Z")

</div>

@bruce, I’ve just read in another thread that you are the original creator of CSL. That’s amazing to meet you here in person!

Once upon a time, exactly 9 years ago in July, I was writing my PhD thesis and instead of writing the thesis I spent a whole week creating a custom CSL style for my dissertation. The requirements to that style were very stupid, posed by a standard called DSTU —Ukrainian analogue of Russian GOST, both based on ISBD — which was not really a citation style but something called bibliographic description. I think I was still using Mendeley back then or right in transition to Zotero. Anyway, since my discipline is chemistry, moreover a field of chemistry too far away from any computers and programming, I had a very hard time — had to start with reading what was XML in the first place. But that week, looking at it retrospectively, determined a lot in my relationship with computers. So the fact that I’m involved in `org-roam-bibtex` now, making my small contributions to `org-roam`, I really owe to you 🙂

---

<div class="post-metadata">

**Author:** ![bruce](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@bruce](https://org-roam.discourse.group/u/bruce)\
**Post date:** [June 3, 2020, 11:16am UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/9 "2020-06-03T11:16:38Z")

</div>

> [@mshevchuk](#):
>
> I don’t say Zotero is bad or whatever, the question was about how one manages their references. So this is just my story of a 10 years long personal experience.

Right; really depends on your priorities.

The team that created Zotero, BTW, is headed up by historians. So it’s better optimized for, say, humanities, than others that may be better for sciences.

---

<div class="post-metadata">

**Author:** ![mshevchuk](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mshevchuk](https://org-roam.discourse.group/u/mshevchuk)\
**Post date:** [June 3, 2020, 3:09pm UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/10 "2020-06-03T15:09:17Z")

</div>

> [@bruce](#):
>
> The team that created Zotero, BTW, is headed up by historians. So it’s better optimized for, say, humanities, than others that may be better for sciences.

Well, I couldn’t complain about that.

It just appeared to me that Zotero uses a sqlite database as storage backend. So far, correct me if I’m wrong, all the Emacs connectors for Zotero used its web API to communicate with it. I wonder how feasible would it be to hack the Zotero sqlite database directly from Emacs. Since `emacsql-sqlite3` is now quite a mature project, would it be reasonable to do some perhaps on-the-fly mapping between Zotero and .bib file?

After quick googling I’ve found this project: [GitHub - whacked/zotero-query.el: query local zotero database from emacs](https://github.com/whacked/zotero-query.el)  
It is able

> “to query the zotero db + open files, without having to have a running zotero instance”

And even provides custom `zotero:` links for Org-mode.

---

<div class="post-metadata">

**Author:** ![bepolymathe](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/bepolymathe/32/688_2.png) [@bepolymathe](https://org-roam.discourse.group/u/bepolymathe)\
**Post date:** [June 5, 2020, 6:56am UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/11 "2020-06-05T06:56:36Z")

</div>

> [@mshevchuk](#):
>
> It just appeared to me that Zotero uses a sqlite database as storage backend. So far, correct me if I’m wrong, all the Emacs connectors for Zotero used its web API to communicate with it. I wonder how feasible would it be to hack the Zotero sqlite database directly from Emacs. Since `emacsql-sqlite3` is now quite a mature project, would it be reasonable to do some perhaps on-the-fly mapping between Zotero and .bib file?

Really interesting 🙂

---

<div class="post-metadata">

**Author:** ![bruce](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@bruce](https://org-roam.discourse.group/u/bruce)\
**Post date:** [June 5, 2020, 10:34am UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/12 "2020-06-05T10:34:47Z")

</div>

> [@mshevchuk](#):
>
> Since `emacsql-sqlite3` is now quite a mature project, would it be reasonable to do some perhaps on-the-fly mapping between Zotero and .bib file?

What does that give a user that [better bibtex](https://retorque.re/zotero-better-bibtex/) doesn’t?

---

<div class="post-metadata">

**Author:** ![mshevchuk](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mshevchuk](https://org-roam.discourse.group/u/mshevchuk)\
**Post date:** [June 5, 2020, 10:53am UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/13 "2020-06-05T10:53:45Z")

</div>

Native Emacs interface to Zotero? It’d be a rather complex project, however, on par with better bibtex. And very niche, and with many caveats. I doubt it’s feasible therefore.

---

<div class="post-metadata">

**Author:** ![cobblepot](https://avatars.discourse-cdn.com/v4/letter/c/dec6dc/32.png) [@cobblepot](https://org-roam.discourse.group/u/cobblepot)\
**Post date:** [June 6, 2020, 4:37am UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/14 "2020-06-06T04:37:30Z")

</div>

> [@mshevchuk](#):
>
> Unfortunately, I coudn’t make it along my way with them. I heavily relied on Better BibLaTeX extension for Zotero and it could even insert Org-ref cite links into Emacs, as far as I remember, I had to tinker with javascript to have a customize exporter which would support my BibTeX keys. But after all, the biggest challenge for me was keeping two databases - Zotero and my master .bib in sync. All these exports, they really - I mean really, without a hassle, work one way. Maybe the things are different now.

I’m not sure why one-way is a problem if I manage my references in Zotero and have the BetterBibTex extension keep my .bib file updated. Is there any reason I’d want/need to edit the .bib file directly in emacs?

---

<div class="post-metadata">

**Author:** ![bruce](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@bruce](https://org-roam.discourse.group/u/bruce)\
**Post date:** [June 6, 2020, 2:42pm UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/15 "2020-06-06T14:42:11Z")

</div>

> [@cobblepot](#):
>
> I’m not sure why one-way is a problem if I manage my references in Zotero and have the BetterBibTex extension keep my .bib file updated. Is there any reason I’d want/need to edit the .bib file directly in emacs?

I don’t think so; no. This is with the caveat that you have BBT setup to maintain the correct citekeys.

---

<div class="post-metadata">

**Author:** ![scotto](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@scotto](https://org-roam.discourse.group/u/scotto)\
**Post date:** [December 9, 2020, 10:15pm UTC](https://org-roam.discourse.group/t/citations-with-org-ref-ox-bibtext-zotxt-use-differences/215/16 "2020-12-09T22:15:27Z")

</div>

One potential problem with using zotero as the overall reference DB is that there’s no way to check the zotero DB into source code control – at least I don’t know of one.

I guess you could check the temporary .bib file into git (re-import .bib to zotero, if there’s a problem), but the .bib file might be missing zotero-specific meta information; you’d have to always remember that certain zotero functions produce non-retrievable meta-info.
