From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Lawrence Subject: Re: More questions about CSL and org-mode Date: Sun, 06 Dec 2015 15:24:21 -0800 Message-ID: <87r3izupne.fsf@berkeley.edu> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45751) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5iew-0001uo-66 for emacs-orgmode@gnu.org; Sun, 06 Dec 2015 18:24:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5iet-0001SO-2d for emacs-orgmode@gnu.org; Sun, 06 Dec 2015 18:24:02 -0500 Received: from mail-pf0-x236.google.com ([2607:f8b0:400e:c00::236]:34065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5ies-0001SA-NN for emacs-orgmode@gnu.org; Sun, 06 Dec 2015 18:23:58 -0500 Received: by pfbg73 with SMTP id g73so55887872pfb.1 for ; Sun, 06 Dec 2015 15:23:56 -0800 (PST) In-Reply-To: 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: John Kitchin , Org Mode Hi John, John Kitchin writes: > Hi all, > > This is mostly for the people working on citations in org-mode. > > I have been reading about CSL more this weekend. IIRC, one of the > reasons to develop the new citation syntax was to get the ability to > have pre/post text in citations more conveniently than what is currently > possible. Yes, that is my understanding, too. > I have not seen any possibility for this with CSL, however. Is my > understanding correct? Is this a problem, or something partially handled > by org-export and partially by a citeproc? The CSL processors I've looked at support prefix and suffix text for individual references within a citation. See, for example, the citeproc-js documentation: http://gsl-nagoya-u.net/http/pub/citeproc-doc.html#citation-data-object prefix, suffix, and some other fields are supported. pandoc-citeproc supports the same set of fields. However, my understanding is that neither citeproc-js nor pandoc-citeproc support a BibLaTeX-style "common" prefix/suffix that belongs to the citation as a whole, rather than the individual references within it, as is available in the multi-cite commands. We currently have support for such common prefixes/suffixes in Org syntax. My solution to this in my org-citeproc wrapper for pandoc-citeproc is to prepend the common prefix to the prefix for the first reference in a citation, and append the common suffix to the last reference. This is not a great solution, because it is not really defined what kind of punctuation (if any) should separate the common prefix from the first item's prefix, and so on. But I figured that was not an important issue to address until we actually have people making use of common prefix and suffix syntax who are not exporting to LaTeX... > IIUC, the current aim is to get a citeproc that will do the following on > export: > 1. replace in-text citation syntax with org-formatted replacements > 2. Insert an org-formatted bibliography somewhere in the document > 3. proceed with org-to-something export, with built-in > exporters. That's basically my understanding too. There is one snag with the "org-formatted replacement" plan, though, which I saw in a Zotero dev discussion yesterday. CSL processing might result in multiple levels of formatting, e.g. nested italics like Something with an internal Title and that won't translate very well back to Org syntax in general: /Something with an internal /Title// The suggestion was to just use HTML output, and then parse the HTML to get a data structure that could be directly rendered into HTML, LaTeX, etc., which support nested italics just fine. I think we could do this, though maybe there's a better solution. That is, we can take HTML from the citation processor and go directly to org-element objects, without producing and re-parsing citations in Org format. > The current contenders for a citeproc are Zotero and Pandoc. > > Has anyone looked at https://pypi.python.org/pypi/citeproc-py/ > or https://github.com/inukshuk/citeproc-ruby > > The ruby one looks pretty advanced. I haven't looked at them closely. My impression was that the Python version was quite incomplete; and unfortunately, I don't know Ruby, so I would be the wrong person to evaluate it (or write code for it). Best, Richard