From mboxrd@z Thu Jan 1 00:00:00 1970 From: Erik Hetzner Subject: Re: zotero-cite (A Proposal) Date: Tue, 15 Nov 2011 21:25:45 -0800 Message-ID: <87ty641vvq.wl%egh@e6h.org> References: <81hb2drhmu.fsf@gmail.com> <81mxc4ovlh.fsf@gmail.com> <87k477hnqy.wl%egh@e6h.org> <81k4762yab.fsf_-_@gmail.com> Reply-To: Erik Hetzner Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Tue_Nov_15_21:25:41_2011-1" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:59050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQY11-00059z-Jj for emacs-orgmode@gnu.org; Wed, 16 Nov 2011 00:26:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RQY0x-0004Q8-2n for emacs-orgmode@gnu.org; Wed, 16 Nov 2011 00:26:31 -0500 Received: from mail-iy0-f169.google.com ([209.85.210.169]:59116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RQY0w-0004Q1-TE for emacs-orgmode@gnu.org; Wed, 16 Nov 2011 00:26:27 -0500 Received: by iaek3 with SMTP id k3so132801iae.0 for ; Tue, 15 Nov 2011 21:26:25 -0800 (PST) In-Reply-To: <81k4762yab.fsf_-_@gmail.com> 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: Org Mode , mail@christianmoe.com --Multipart_Tue_Nov_15_21:25:41_2011-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Jambunathan, Sorry I took some time to reply. Some answers are below. At Sat, 12 Nov 2011 02:04:52 +0530, Jambunathan K wrote: >=20 > Hello Erik >=20 > Good news.=20 >=20 > Getting a frugal Zotero-based citations is *definitely* possible. It is > just a matter of time. Your libraries already provide the necessary > plumbing to accomplish the job.=20 >=20 > Long story > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > For my own understanding, I tried trimming down zot4rst to it's bare > essentials and the attached zotcite.py is the result. That looks like the essence. Most of the code in zot4rst, as you saw, deals with interacting with the docutils system and generating output. > What zotcite does is this:=20 >=20 > For two Zotero Items, it prints their Bibliogrpahic entries and their > Citation Reference, in "Text" format using Chicago-Author-Date style. >=20 > I believe a commandline interface could be built around this file along > the following lines. (Will you be interested in building this interface > for us?) >=20 > $ zotcite --style chicago --format --items I1, I2 --print biblio > $ zotcite --style chicago --format --items I1, I2 --print citeref > > Once this is done, Emacs/Org can do invoke zotcite and get the required > Bibliographic definitions and references using "shell-command". I=E2=80=99ve adapted your script into a command line program, now included with zotero-plain. The options are slightly different, and --format does not work yet, but the essence is there. Of course it requires the user to have python, etc. installed, but it is probably easier than rewriting everything in emacs lisp. =20 > The assumption is that Emacs/Org somehow has captured zotero keys > through org-protocol or org-zotero.el or someother means. >=20 > Here is a output from zotcite.py. >=20 > [=E2=80=A6] >=20 > IIRC, I made two changes to the export.js in your Javascript backend. >=20 > 1. I had trouble understanding the organization of citation clusters. So > I modified getCitationBlock as below. Note the use of "true" as a > second param of the appendCitationCluster. This is OK as > registerItemIds already does updateItems(). Thanks for catching this. That might speed things up a bit. > [=E2=80=A6] >=20 > 2. There should be way to set the output format form python side of > things. I had to modify instantiateCiteProc by hand to set the output > format to "text". You know what output format that LibreOffice plugin > uses? I see "text", "html" and "rtf" as output formats. But not ODT. > See https://bitbucket.org/fbennett/citeproc-js/src/tip/src/formats.js Sure, this would be easy. I don=E2=80=99t know how the LibreOffice plugin works. It doesn=E2=80=99t t= ake much code, however, to translate the HTML output into something else. > [=E2=80=A6] >=20 > Btw, I found that with my 2-day old zotero database and for printing the > above 2 keys, the whole machinery takes a perceivably a lot of time. Is > this your experience as well? I am not a netbook. Yes, it is slow for me too. I wish it were faster. I don=E2=80=99t know if = the issue is jsbridge, or something else. Ideally I would prefer to simply fetch citations information (as JSON, for instance) from Zotero and process in an embedded citeproc-js instance. best, Erik --Multipart_Tue_Nov_15_21:25:41_2011-1 Content-Type: text/plain; charset=US-ASCII Sent from my free software system . --Multipart_Tue_Nov_15_21:25:41_2011-1--