On 2016-09-14 07:55, Kaushal Modi wrote: > On Mon, Sep 12, 2016 at 11:14 PM Clément Pit--Claudel > wrote: > > Sure thing :) Here it is: > > > Thanks! This works great! I added it to `org-export-before-processing-hook'. Glad to hear that :) > I did not understand why you mentioned: "I call this before calling `org-latex-export-to-latex'.". Back when I wrote this I was starting out with Org-mode, I was in a hurry, and I didn't know about org-export-before-processing-hook :) So instead I had a larger ELisp script that opened the file, ran this filter, then called org-latex-export-to-latex :) > I plan to add a "not" condition to this. That way, with below: > > #+BEGIN_ONLY tex > foo > #+END_ONLY tex > > #+BEGIN_EXCEPT tex > bar > #+END_EXCEPT tex > > foo will be exported only for tex, and for every other backend, bar will be exported. > > WDYT? Looks good. Maybe using the same syntax for both would be good though; something like "BEGIN_ONLY tex" and "BEGIN_ONLY :not tex" maybe? We could probably get rid of the "tex" part after the END_ONLY, and change "tex" to "latex" for consistency with BEGIN_EXPORT :) Cheers, Clément.