From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giacomo M Subject: Expansion of macros conditional on export type Date: Fri, 27 May 2016 12:03:15 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/html; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Eby-0007t9-HB for emacs-orgmode@gnu.org; Fri, 27 May 2016 06:03:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6Ebu-0006PZ-AO for emacs-orgmode@gnu.org; Fri, 27 May 2016 06:03:21 -0400 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:37013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Ebu-0006PU-3k for emacs-orgmode@gnu.org; Fri, 27 May 2016 06:03:18 -0400 Received: by mail-wm0-x22a.google.com with SMTP id z87so130667133wmh.0 for ; Fri, 27 May 2016 03:03:17 -0700 (PDT) Received: from [127.0.0.1] ([212.189.161.135]) by smtp.gmail.com with ESMTPSA id c2sm7871458wme.4.2016.05.27.03.03.16 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 May 2016 03:03:16 -0700 (PDT) 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" To: emacs-orgmode@gnu.org

Dear all,

I'm working on a paper where some co-authors use word and some (myself included) latex. Org seems the perfect way to mantain a central version. How do I deal with constructs that should be exported in different ways, e.g. \textdegree{} in latex vs corresponding symbol in odt, or \ce{CO2} vs CO_2? For citations I'm using org-add-link-type as found in reddit, but it looks cumbersome to create specific alternatives via links each time. Another issue seems to declare institutes along with authors in latex vs odt in the title section.

I know one way would be to use @@latex: ... @@ w/ ascii counterpart each time, but I would rather envision a single macro, which then gets defined in different way depending on the export, in order to reduce redundancy.

Any ideas on where I can find related best practices?

Thanks,

Giacomo M

From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Expansion of macros conditional on export type Date: Fri, 27 May 2016 11:17:53 +0100 Message-ID: <87shx3954e.fsf@ucl.ac.uk> References: Reply-To: Eric S Fraga 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]:37121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6EqD-0004ux-82 for emacs-orgmode@gnu.org; Fri, 27 May 2016 06:18:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6Eq9-0001im-1d for emacs-orgmode@gnu.org; Fri, 27 May 2016 06:18:04 -0400 Received: from mail-am1on0144.outbound.protection.outlook.com ([157.56.112.144]:17472 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Eq8-0001ib-MQ for emacs-orgmode@gnu.org; Fri, 27 May 2016 06:18:00 -0400 In-Reply-To: (Giacomo M.'s message of "Fri, 27 May 2016 10:03:15 +0000") 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" To: Giacomo M Cc: "emacs-orgmode@gnu.org" > I know one way would be to use @@latex: ... @@ w/ ascii counterpart > each time, but I would rather envision a single macro, which then gets > defined in different way depending on the export, in order to reduce > redundancy. You can put all the different alternatives together? I do the following for degrees Celsius: #+macro: degc @@odt:=C2=B0C@@@@latex:\(^{\circ}\)C@@ Looks ugly but I don't have to look at it often. In text, I simply have {{{degc}}}. (minor aside: I wish macros had been defined to be used with [[[degc]]] instead as much easier to type than {{{degc}}}) --=20 : Eric S Fraga (0xFFFCF67D), Emacs 25.0.94.1, Org release_8.3.4-869-gf2c421 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giacomo M Subject: Re: Expansion of macros conditional on export type Date: Fri, 27 May 2016 12:26:48 +0200 Message-ID: References: <87shx3954e.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Eyl-0005UQ-1k for emacs-orgmode@gnu.org; Fri, 27 May 2016 06:26:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6Eyg-0003hk-S9 for emacs-orgmode@gnu.org; Fri, 27 May 2016 06:26:53 -0400 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:34918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Eyg-0003ha-Lj for emacs-orgmode@gnu.org; Fri, 27 May 2016 06:26:50 -0400 Received: by mail-wm0-x234.google.com with SMTP id a136so65880098wme.0 for ; Fri, 27 May 2016 03:26:50 -0700 (PDT) Received: from [127.0.0.1] ([212.189.161.135]) by smtp.gmail.com with ESMTPSA id jd4sm18673498wjb.43.2016.05.27.03.26.49 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 May 2016 03:26:49 -0700 (PDT) In-Reply-To: <87shx3954e.fsf@ucl.ac.uk> 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" To: "emacs-orgmode@gnu.org" Il 27/05/2016 12:17, Eric S Fraga ha scritto: >> I know one way would be to use @@latex: ... @@ w/ ascii counterpart >> each time, but I would rather envision a single macro, which then gets >> defined in different way depending on the export, in order to reduce >> redundancy. > You can put all the different alternatives together? I do the following > for degrees Celsius: > > #+macro: degc @@odt:°C@@@@latex:\(^{\circ}\)C@@ > > Looks ugly but I don't have to look at it often. In text, I simply have > {{{degc}}}. > > (minor aside: I wish macros had been defined to be used with [[[degc]]] > instead as much easier to type than {{{degc}}}) > Perfect! Actually I hadn't tried to combine them. For chunks of text like institute affiliations, may I ask if you use different BEGIN_EXPORT blocks or sth else? Thanks a lot, Giacomo From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Expansion of macros conditional on export type Date: Fri, 27 May 2016 12:08:36 +0100 Message-ID: <87oa7r92rv.fsf@ucl.ac.uk> References: <87shx3954e.fsf@ucl.ac.uk> Reply-To: Eric S Fraga Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6FdI-0008P7-5I for emacs-orgmode@gnu.org; Fri, 27 May 2016 07:08:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6FdD-0005gp-19 for emacs-orgmode@gnu.org; Fri, 27 May 2016 07:08:46 -0400 Received: from mail-am1on0145.outbound.protection.outlook.com ([157.56.112.145]:25312 helo=emea01-am1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6FdC-0005gT-NF for emacs-orgmode@gnu.org; Fri, 27 May 2016 07:08:42 -0400 In-Reply-To: (Giacomo M.'s message of "Fri, 27 May 2016 10:26:48 +0000") 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" To: Giacomo M Cc: "emacs-orgmode@gnu.org" On Friday, 27 May 2016 at 10:26, Giacomo M wrote: > For chunks of text like institute affiliations, may I ask if you use > different BEGIN_EXPORT blocks or sth else? Depends. Most often a sequence of #+latex_header: lines as my eventual target for export is almost always LaTeX for submission to journals. -- : Eric S Fraga (0xFFFCF67D), Emacs 25.0.94.1, Org release_8.3.4-869-gf2c421