emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: Marcelo de Moraes Serpa <celoserpa@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: Org as a publishing toolkit
Date: Thu, 12 May 2011 07:52:19 +0100	[thread overview]
Message-ID: <87wrhw1kd8.fsf@ucl.ac.uk> (raw)
In-Reply-To: <BANLkTikkQeCGx5G77nJRgbHyFCDvevojmg@mail.gmail.com> (Marcelo de Moraes Serpa's message of "Tue, 10 May 2011 13:48:37 -0500")

Marcelo de Moraes Serpa <celoserpa@gmail.com> 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)

  parent reply	other threads:[~2011-05-12  8:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10 17:52 Org as a publishing toolkit Marcelo de Moraes Serpa
2011-05-10 18:31 ` Thomas S. Dye
2011-05-10 18:48   ` Marcelo de Moraes Serpa
2011-05-10 19:19     ` Thomas S. Dye
2011-05-10 20:53       ` Marcelo de Moraes Serpa
2011-05-10 21:35         ` Thomas S. Dye
2011-05-10 21:39           ` Marcelo de Moraes Serpa
2011-05-10 22:26             ` Thomas S. Dye
2011-05-11  0:41               ` Marcelo de Moraes Serpa
2011-05-11  1:40                 ` prad
2011-05-11  4:52         ` Avdi Grimm
2011-05-11  8:09         ` Rasmus
2011-05-12  6:52     ` Eric S Fraga [this message]
2011-05-11 15:15 ` Mike McLean
2011-05-11 16:10   ` Marcelo de Moraes Serpa
2011-05-11 16:33     ` Nick Dokos
2011-05-14 12:32       ` Mike McLean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wrhw1kd8.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=celoserpa@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).