From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: State of the art in citations Date: Sun, 27 Apr 2014 06:01:21 -1000 Message-ID: References: <87ppk4ni6i.fsf@gaillac.origami> <87k3aaoo5d.fsf@gaillac.origami> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WeRWX-0003WC-2Q for emacs-orgmode@gnu.org; Sun, 27 Apr 2014 12:01:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WeRWR-00027v-0x for emacs-orgmode@gnu.org; Sun, 27 Apr 2014 12:01:49 -0400 Received: from gproxy2-pub.mail.unifiedlayer.com ([69.89.18.3]:60682) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1WeRWQ-00027O-Qm for emacs-orgmode@gnu.org; Sun, 27 Apr 2014 12:01:42 -0400 In-Reply-To: <87k3aaoo5d.fsf@gaillac.origami> (=?utf-8?Q?=22Cl=C3=A9ment?= B."'s message of "Sun, 27 Apr 2014 16:14:22 +0200") 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: "=?utf-8?Q?Cl=C3=A9ment?= B." Cc: julian@hafro.is, Leonard Randall , emacs-orgmode Cl=C3=A9ment B. writes: > Hi Leonard, > >> I am in the process of writing a new package for inserting >> citations into org buffers using RefTeX. > > I'd be interested to know what you have in mind. I use something > of the sort, by customising `reftex-cite-format`, e.g: > > (setq reftex-cite-format > '((?\C-m . "\\cite[]{%l}") > (?b . "[[ref:%l][%A (%y)]]"))) > > This makes inserting custom links ("ref") easier with the usual > `reftex-citation` bound to C-c [. > > >> On the other hand, it will work with multicite commands, >> whereas Clement's does not look like it will. > > It does not, and that's a big limitation. That being said, I don't > know how to go about mixing multiple citations and links to the > bib file. This is definitely something I care about, being able > to quickly jump from the text to the bibliographic entry, PDF > file, or whatever source I am using to write is one of the main > reasons I use org instead of plain LaTeX. One approach for muliticites is to drop a placeholder and then replace it with an export filter. I've been using these two for a while and they seem to work fine. ** Filters for multicites *** Filter for parencites Add the placeholder with alt-p #+name: tsd-parencites #+BEGIN_SRC emacs-lisp (defun tsd-latex-filter-parencites (text backend info) "Replace parencites placeholders in Beamer/LaTeX export." (when (memq backend '(beamer latex)) (replace-regexp-in-string "=CF=80" "\\parencites" text nil t))) (add-to-list 'org-export-filter-plain-text-functions 'tsd-latex-filter-parencites) #+END_SRC *** Filter for textcites Add the placeholder with alt-t #+name: tsd-textcites #+BEGIN_SRC emacs-lisp (defun tsd-latex-filter-textcites (text backend info) "Replace textcites placeholders in Beamer/LaTeX export." (when (memq backend '(beamer latex)) (replace-regexp-in-string "=E2=80=A0" "\\textcites" text nil t))) (add-to-list 'org-export-filter-plain-text-functions 'tsd-latex-filter-textcites) #+END_SRC It looks like this in the text: A recent replication experiment that used stone tools in the manufacture of an outrigger canoe identified six functional types of stone adze that correspond generally with the six types established by Duff =CF=80[[multicite:turner00:_funct_desig_distr_new_zealan_adzes][;;turner diss]] [[multicite:turner05:_funct_and_techn_explan_for][;;turner nzja]]. My link syntax is a bit different, but the same basic idea: (org-add-link-type "multicite" 'ebib-open-org-link (lambda (path desc format) (cond ((eq format 'latex) (if (not desc) (format "{%s}" path) (format "[%s][%s]{%s}" (cadr (split-string desc ";")) (car (split-string desc ";")) path)))))) hth, Tom --=20 Thomas S. Dye http://www.tsdye.com