From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: multi-line citation export issue Date: Mon, 13 Jan 2014 10:23:45 -0500 (EST) Message-ID: References: <874n58lpe8.fsf@gmail.com> <87zjn0jg26.fsf@gmail.com> Reply-To: Ken Mankoff Mime-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2jMs-0000zD-C7 for emacs-orgmode@gnu.org; Mon, 13 Jan 2014 10:24:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W2jMi-0004i5-CG for emacs-orgmode@gnu.org; Mon, 13 Jan 2014 10:23:58 -0500 Received: from mail-qa0-x229.google.com ([2607:f8b0:400d:c00::229]:64864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2jMi-0004i1-87 for emacs-orgmode@gnu.org; Mon, 13 Jan 2014 10:23:48 -0500 Received: by mail-qa0-f41.google.com with SMTP id w8so1390524qac.28 for ; Mon, 13 Jan 2014 07:23:47 -0800 (PST) In-Reply-To: <87zjn0jg26.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: Nicolas Goaziou Cc: Org-mode Hi Nicolas et al., On Mon, 13 Jan 2014, Nicolas Goaziou wrote: > Ken Mankoff writes: > >> I am not familiar with export snippets, but I guess from that >> syntax that I will not be able to export with citations to >> ODT/DOC. Right now one org file exports well to both formats. > > You can also write the same for odt: > > @@odt:\cite{key}@@ > > So, in your buffer, it would become: > > @@latex:\cite{key}@@@@odt:\cite{key}@@ > > And you can avoid the implied repetition with a macro: > > #+MACRO: cite @@latex:\cite{$1}@@@@odt:\cite{$1}@@ > > and write in your document: > > {{{cite(key)}}} > > Note that you will need to escape commas (with backslashed) in key. > > This also works for your more complicated example : > > #+MACRO: cite2 @@latex:\cite[$1]{$2}@@@@odt:\cite[$1]{$2}@@ > Wow. I was going point out that citing for both formats is cumbersome and makes the document hard-to-read, but the MACRO solves this. I was not aware of MACRO's. I guess this is both the beauty and pain of Org and emacs, all this customization. And down the rabbit-hole I go, because now I need to redefine my RefTeX shortcut so that it inserts {{{cite(key)}}} instead of \cite{key}. Unfortunately this is probably not something I have the skill to do right now. Perhaps I could get it for one citation, but the regex detect when inside an existing cite command and just insert the key, not the latex command wrapping it, is beyond my lisp skill and time. I'll just deal with no spaces inside \cite{a,b}. But thank you for teaching me about MACRO anyway. -k.