Eric S Fraga <e.fr...@ucl.ac.uk> writes: > On Tuesday, 3 Nov 2015 at 15:54, Phillip Lord wrote: >> I am trying to implement a new backend based on the HTML export. I need >> to do some post-processing to the source blocks that needs to be >> optional. For some blocks I need to replace "[" with "\[" and for some I >> don't. >> >> I am not sure whether to use headers or switches. > > What about neither? Maybe something along #+ATTR_XXX: instead, where > XXX is the name of your derived backend, along the lines of ATTR_HTML > and ATTR_LATEX? > > Others may tell us that my suggestion is worse but I think playing > around with the babel syntax is asking for trouble...
That's a good call, I think. The latex example is very clear, so I've got that implemented now. Are these form of attributes specific to the source block which they precede? Or is it possible to do any kind of inheritance with them? For my use case, all the code blocks inside a Header One block will behave in the same way (either with \[ escaping or without). Not a major problem if not, I can template it if not, but useful to know. Phil