From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: zotero plain, org-odt, and citations in general Date: Thu, 10 Nov 2011 05:50:00 -1000 Message-ID: References: <81hb2drhmu.fsf@gmail.com> <81mxc4ovlh.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:46397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROWtR-0004gg-Di for emacs-orgmode@gnu.org; Thu, 10 Nov 2011 10:50:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROWtN-0000ui-RU for emacs-orgmode@gnu.org; Thu, 10 Nov 2011 10:50:21 -0500 Received: from oproxy5-pub.bluehost.com ([67.222.38.55]:50772) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1ROWtN-0000uA-6w for emacs-orgmode@gnu.org; Thu, 10 Nov 2011 10:50:17 -0500 In-Reply-To: <81mxc4ovlh.fsf@gmail.com> (Jambunathan K.'s message of "Thu, 10 Nov 2011 20:47:30 +0530") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Jambunathan K Cc: Erik Hetzner , Org Mode , mail@christianmoe.com Jambunathan K writes: >> 1. org-zotero.el >> >> This permits insertion of zotero reference links *only* and >> opening them with a browser.=20 >> >> Specifically I don't see the translator of these links to >> individual backends like latex, html or more importantly ODT. >> >> #+begin_src emacs-lisp >> (org-add-link-type TYPE &optional FOLLOW EXPORT) >> #+end_src >> >> 2. zotero.el >> >> This (apparently) permits download of data from firefox and >> importing it within Emacs. > > > I think I now have some understanding of what Erik's library does[1].=20 > > It creates a bibliographic entry (as in Footnotes) using Quick Copy. It > doesn not create a footnote reference. One can use the Firefox Zotero > and see how Quick Copy works with both RTF and HTML formats[2]. > > [Question to Erik: Can one not use "Copy from Clipboard" from elisp > instead of going the mozrepl route to create a biblio.text] > > Instead of working with JS libraries, I think the right starting point > would be to work with the underlying zotero.sqlite database itself. It > is not difficult to get a key of the selected item in Zotero > pane[3]. Once this is done the underlying zotero.sqlite database could > be queried for the item properties[4]. > > Fortunately there is already a GUI/Command line tool - Gnotero[5] -for > accessing the sqlite database. > > As for exploiting the power of using zotero within libreoffice - which > is to have the same citation presented in different citation styles - > one need to look at how the reference marks are produced within > OpenDocument XML. > > Here is a typical reference mark for an item with local zotero URL[6]: > zotero://report/items/579241_E7232HE2/html/report.html > > LIBRARY=3D>579241 > KEY=3D>E7232HE2 > > > #+begin_src nxml > > > > #+end_src nxml > > One can see the following components: > 1. ZOTERO_ITEM=20 > 2. citationID and citationItems > - The citationItem has the following Zotero URI: > http://zotero.org/groups/51961/items/E7232HE2 >=20=20=20=20=20=20 > GROUP=3D>51961 > KEY=3D>E7232HE2 > > Note that the keys for the entry are the same on both the local > zotero store and the global zotero URI. > 3. RNDB7mi3QiueI > - This is a cookie entered by Zotero which maps the citation entry to > an entry in the zotero database. Note that it starts with RND. > > This is what is called as a "FieldCode" in zotero parlance. > > Note: Have you seen the "Remove Field Codes" in Zotero menu within > ODT document. Once you remove the field codes the document becomes > a simple ODT document and one would no longer be able to move > between different citation styles. > > In essence, "Field Code" is the MAGIC WAND that zotero uses. > > From my little research, I can say with confidence that global zotero > URIs and the above mentioned reference marks are *very* recent > developments. > > Exercising the MAGIC WAND within ODT exporter requires diving in to > zotero server inner workings - which is non-trivial as Erik notes - but > would also be futile (as in chasing a shifting sand) > > I believe the best course would be to do convention/static footnoting > with the simplest of Chicago styles using a choice of entry types like > Article, Journal, Book or a Website. > > Proposal for Org+Zotero integration > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > An org document like this > > #+begin_src org > * Headline > This is a footnote reference[1] > > Footnotes: > [1] zotero://report/items/579241_E7232HE2/html/report.html > #+end_src org > > will be transformed to this on ODT export > > #+begin_odt > * Headline > This is a footnote reference[1]=20=20=20=20=20 > > Bibliography: > > 1. David F. Crew, =E2=80=9CAlltagsgeschichte: A New Social History =E2=80= =98From > below=E2=80=99?,=E2=80=9D Central European History 22, no. 3/4 (1989): 39= 4-407. > #+end_odt > > Note that the footnote link is an org stlye link captured with > org-protocol and has both a LIBRARY_ID and KEY_ID. The bibliography > entry will be generated by "exporting" zotero link to the required > format using a variation of gnotero. The "following/opening" of zotero > link will be done by mapping the local zotero link to > http://zotero.org-based URI (again) using gnotero. > > > I see that there is a need for bib2odt in much the same way as there is > a bib2html. Can someone post an example of Org file which would use > BibTex for post-processing (either to HTML or LaTeX) The ODT exporter > can also emulate what other backend does. > > ps: This mail is more of a note to self or a note to any future > hackers. I am not certain I will be able to hack gnotero and have it > integrate with Emacs - but for a whimsical and a bored hacker like > nothing can be said with certainty. > > Btw, gnotero is good. Not sure how usable it is though ... > > Jambunathan K. > > Footnotes:=20 > > [1] With Mozrepl 1.1 beta2 on Firefox 3.6.23, I am unable to make > org-zotero.el work. It hangs and I have to C-g out (Christian! you are > not alone). I am able to get as far as creating the LIBRARY_KEY for the > selected item in the zotero pane and not further. > > [2] Quick Copy: http://www.zotero.org/support/creating_bibliographies > > [3] For producing ITEM keys: One could use zotero.el or simply "Right > Click" on an item and do a "Generate Report from Selected Item". The > resulting url in firefox could be captured using org-protocol and > imported in to the org buffer. A typical URL looks like this: > > zotero://report/items/0_6EETTDBE/html/report.html > 0 =3D> My Library > 6EETTDBE =3D> Key of the selected item > > or=20 > zotero://report/items/579241_E7232HE2/html/report.html > 579241 =3D> The local library key for "Digital Humanities UofT group" > E7232HE2 =3D> Key of the selected item. > > [4] For locating zotero.sqlite and querying it with Sqlite Manager see > - https://www.zotero.org/utils/dbfix/ > - http://kimmonsdesign.com/node/24 > > [5] http://cogsci.nl/software/qnotero > http://www.cogsci.nl/blog/tutorials/97-writing-a-command-line-zotero-clie= nt-in-9-lines-of-code > http://files.cogsci.nl/software/gnotero/extras/gnotero_cmdline.py > > [6] See the attached zotero-libreoffice.odt Aloha Jambunathan, For examples of Org-mode files that use bibtex, the following might be helpful. A tutorial of sorts: http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-17 A piece of reproducible research: https://github.com/tsdye/LKFS hth, Tom --=20 Thomas S. Dye http://www.tsdye.com