From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Lawrence Subject: Re: Citation syntax: a revised proposal Date: Mon, 16 Mar 2015 22:15:00 -0700 Message-ID: <87y4mw19yj.fsf@berkeley.edu> References: <87k2zjnc0e.fsf@berkeley.edu> <87zj8co3se.fsf@berkeley.edu> <87ioezooi2.fsf@berkeley.edu> <87mw4bpaiu.fsf@nicolasgoaziou.fr> <8761aznpiq.fsf@berkeley.edu> <87twyjnh0r.fsf@nicolasgoaziou.fr> <87oaopx24e.fsf@berkeley.edu> <87k2zd4f3w.fsf@nicolasgoaziou.fr> <87egpkv8g9.fsf@berkeley.edu> <877fv6xfaq.fsf@gmail.com> <87twya2ak0.fsf@berkeley.edu> <87zj81aa97.fsf@nicolasgoaziou.fr> <87ioep2r6p.fsf@berkeley.edu> <87y4ngbgm7.fsf@nicolasgoaziou.fr> <87bnkbi61v.fsf@gmail.com> <87a8zlmujp.fsf@gmail.com> <87ioe8yftp.fsf@berkeley.edu> <871tkwmh87.fsf@gmail.com> <87sidb8mm7.fsf@berkeley.edu> <87lhj07ol0.fsf@berkeley.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXjqy-00048p-GV for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 01:15:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXjqt-00060Y-E2 for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 01:15:44 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:33444) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXjqt-00060U-5M for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 01:15:39 -0400 Received: by pagr17 with SMTP id r17so86576215pag.0 for ; Mon, 16 Mar 2015 22:15:37 -0700 (PDT) In-Reply-To: <87lhj07ol0.fsf@berkeley.edu> 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: Aaron Ecay Cc: emacs-orgmode@gnu.org Hi Aaron and all, Richard Lawrence writes: > I'll take some time this weekend to see if I can wire this together with > the Elisp Aaron wrote for the Org exporter side. I've had some success with this. I would not say that my efforts are complete yet, but I thought I should send an update to let everyone know. I've published a branch here: https://github.com/wyleyr/org-mode which derives from Aaron's wip-cite-awe branch. Basically, what I've been able to do so far is process citations in a document via org-citeproc, using a bibtex database file, then insert the processed citations and bibliography in the document during export. (In theory, this should work with org-bibtex too, though I think I may have introduced a bug...the library is not producing well-formed bibtex from org-bibtex entries for me at the moment.) It works pretty slick, at least for the simple cases I've tested. Aaron, now that I've had time to go through your code a bit more carefully, here are a few comments: In general, I like the design of the org-cite library! It was pretty easy for me to understand what's going on, and it was also pretty easy for me to make it use org-citeproc, just by plugging in different helper functions. This speaks to the modularity of the code and a well-designed API. I like the general approach of pre-processing citations via org-cite-export-prepare and stashing the information on the info plist. I also like the extensibility of the lookup types mechanism. I didn't quite understand all the code surrounding citation modes and styles. I didn't dive into this too much, because I just wanted to get org-citeproc to process citations and produce a bibliography using a CSL file. Rather than figure out how to infer a CSL file from CITATION_STYLE and CITATION_MODE, I just added a new keyword (CSL_FILE) to allow specifying it directly. I am not sure which approach is better, but I certainly found it simpler to use CSL_FILE and let org-citeproc deal with formatting. (One relevant issue here, as you mentioned in an earlier post, is how much we want to worry about keeping LaTeX and non-LaTeX backends in sync. If it's important that they stay very close, the high-level way of specifying citation formatting via CITATION_STYLE and _MODE is probably the way to go. These can be mapped to a BibLaTeX style on the LaTeX side, and a CSL file elsewhere. It might still be good to have low-level keywords like CSL_FILE and, e.g., LATEX_BIB_STYLE too. The LaTeX vs. non-LaTeX issue is also important for dealing with multi-cites, which are not handled in this branch. I am waiting to hear back about the right way to get the list of references associated with a citation before I tackle that.) As for the lookup types mechanism, I think this works pretty well, though I have one suggestion: lookup functions should just be responsible for jumping to the entry referenced by a citation in a BIBDB, not for returning data about it. Returning data only really makes sense if we need to produce a new bibliography file, as in org-cite--make-bibtex, but there are better mechanisms for that case (see org-bibtex-export-to-kill-ring). Jumping to the referenced entry enables this, and makes lookup functions useful interactively. In general, I did find that the cl-lib idioms and other stuff from external libraries made the code more difficult for me to understand (though that's on me), and in at least one case, I had to do without one of the libraries you are loading (namely, let-alist) to get the code to run in a vanilla Emacs 24. I would personally prefer it if this library could stay away from bleeding-edge Emacs features, as I run Org from master, but generally on an older Emacs (my main Emacs is the one in Debian stable). There are just a few points where I had to modify your code, or comment it out, to get it to run in my setup. As a result, I might have broken some things due to lack of understanding. In all cases, my intent was just to make my new code run alongside the existing code via whatever minimal change was necessary, not to remove what was working for you. Best, Richard