From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Cl=C3=A9ment?= B. Subject: Re: State of the art in citations Date: Sat, 26 Apr 2014 20:26:51 +0200 Message-ID: <87oazondzo.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]:38346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1We7JX-0007UU-1x for emacs-orgmode@gnu.org; Sat, 26 Apr 2014 14:27:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1We7JR-00070Q-Qk for emacs-orgmode@gnu.org; Sat, 26 Apr 2014 14:27:02 -0400 Received: from contumacia.investici.org ([178.255.144.35]:33346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1We7JR-0006wZ-Dp for emacs-orgmode@gnu.org; Sat, 26 Apr 2014 14:26:57 -0400 Received: from [178.255.144.35] (contumacia [178.255.144.35]) (Authenticated sender: clement@autistici.org) by localhost (Postfix) with ESMTPSA id 9BFD8E81FE for ; Sat, 26 Apr 2014 18:26:53 +0000 (UTC) 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: emacs-orgmode Hi all, > - Should I use biblatex instead of bibtex? =20 You should. It is very powerful and straightforward. The manual is great. As for citations, I find that the most flexible way is to define my own link types, that allows control on both org formatting and export Let's say for example that you want to cite an entry of your .bib file, which key is Chiles:2012:Geostatistics. Something like : see Chil=C3=A8s 2012, p.145 Note (i) the "see" (ii) the "p.145", they are both part of the citation. In this case, biblatex provides the following command \cite[see][p.145]{Chiles:2012:Geostatistics} For readability purposes, the citation should appear as is in the org file, the "\cite{Chiles:2012:Geostatistics}" command should only appear when exporting to LaTeX. Furthermore, this should be a link to the entry in the .bib file, so the complete org link would look like [[ref:Chiles:2012:Geostatistics][(see for example Chil=C3=A8s 2012, p.145= )]] Where ref is a custom link type to the said bib file. To do that, I have defined the following link-type in my init.el: (org-add-link-type =20 "ref" (lambda (key) (org-open-file cby-references-file t nil key)) (lambda (path desc format) (cond ((eq format 'html) (format "(%s)" path)) ((eq format 'latex) (let* ((postnote (cby-org-link-get-postnote desc)) (prenote (cby-org-link-get-prenote desc))) (cond ((and prenote postnote) (format "\\cite[%s][%s]{%s}" prenote postnote path)) = =20 (postnote (format "\\cite[%s]{%s}" postnote path)) (prenote (format "\\cite[%s][]{%s}" prenote path)) (t (format "\\cite{%s}" path)))))))) Some remarks : 1. `cby-references-file` is my master .bib file. 2. The html export is rather rudimentary, it simply takes the org link description (%s) and puts it between markups. 3. To get the prenote (the "see") and postnote (the "p.145"), I use very shaky functions (`cby-org-link-get-postnote`) that strip the link description. I haven't come up with a proper solution yet so here is one for reference : (defun cby-org-link-get-postnote (desc) "Extract postnote from org-mode link description. Postnote starts at last ',' and ends at last ')'." (let ((postnote (cadr (split-string desc "[,)]")))) (if postnote (copy-sequence ;; clean string (replace-regexp-in-string "[ \t\n]" "" postnote))))) 4. To use the wide range of commands provided by biblatex, I also have a "pref" link type that exports to "\parencite{}" and a "tref" type that exports to "\texcite{}" This is all work in progress, but custom link types make both your org source file readable and export flexible. > I use org-mode to write scientific papers, exporting mostly to LaTex/pd= f > (and sometimes to Word via ODT when I have to collaborate with less > enlightened colleagues) I also tried to do that, but do you have a way to get odt files back to org ? I saw a package for that somewhere. Bye, Cl=C3=A9ment