From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Org as a publishing toolkit Date: Thu, 12 May 2011 07:52:19 +0100 Message-ID: <87wrhw1kd8.fsf@ucl.ac.uk> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:42713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKRWw-0001Ng-6b for emacs-orgmode@gnu.org; Thu, 12 May 2011 04:45:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QKRWs-0007C0-7A for emacs-orgmode@gnu.org; Thu, 12 May 2011 04:45:58 -0400 Received: from vscane-b.ucl.ac.uk ([144.82.108.141]:32973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKRWs-0007Bj-2x for emacs-orgmode@gnu.org; Thu, 12 May 2011 04:45:54 -0400 In-Reply-To: (Marcelo de Moraes Serpa's message of "Tue, 10 May 2011 13:48:37 -0500") 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: Marcelo de Moraes Serpa Cc: Org Mode Marcelo de Moraes Serpa writes: > Cool! Thanks. > > Now that you mention it, I was wondering if something like "condition > export" is possible. For very specific localized LaTeX fetures, it > would be useful. Take this example: > > #+LaTeX_HEADER: \usepackage[T1]{fontenc} > > #+LaTeX:\yinipar{\color{red}H}ello World > > This created a first-letter that is stylized differently. This won't > come out in any other exported, so I'd like to do something like > (NOTE: pseudo-code!) > > #+LaTeX:\yinipar{\color{red}H}ello World > > #iif not LaTeX > Hello World > #end > > If it is not possible what I can do is to pre-process the orgfile with > something like ERB (I'm familiar with Ruby) or another templating > language before exporting (and even automate it all by calling emacs > in batch mode ;) ), but it'd be nice if org supported that > out-of-the-box. One way to have a conditional mode that ignores text if exporting to latex is to use a latex macro that swallows up text. I define my own for clarity: --8<---------------cut here---------------start------------->8--- #+latex: \newcommand{\dummy}[1]{} * Introduction Hello #+latex: \dummy{% world and other #+latex: }% the percent signs are important to minimise white space in export planets. --8<---------------cut here---------------end--------------->8--- In LaTeX, you will get "Hello planets." whereas in any other export you should get "Hello world and other planets." -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.274.gd6aba)