Marcelo de Moraes Serpa <celose...@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)