Suvayu Ali writes:

> Maybe we could allow backend specific macro expansion definitions.
> Something like:
>
>   #+HTML_MACRO: ruby <ruby> $1 <rp>(</rp><rt>$2</rt><rp>)</rp> <\ruby>
>   #+LATEX_MACRO: ruby \ruby{$1}{$2}
>
>   Then {{{ruby(東,ひがし)}}} will be expanded appropriately for
>   different backends.
>
> What do you think?

Existing (8.0) syntax already offers a way to achieve this using export
snippets, which now allow and require you to specify backends. To
recast your example:

  #+macro: ruby @@html:<ruby> $1<rp>(</rp><rt>$2</rt><rp>)</rp> 
</ruby>@@@@latex:\ruby{$1}{$2}@@

  Then {{{ruby(東,ひがし)}}} will be expanded appropriately for
  different backends.

Note: I have no idea if the above actually results in appropriate
rubies, it's just to demonstrate the basic principle that you can write:

  #+macro: foo @@html:<foo>$1</foo>@@@@latex:\foo{$1}@@

Yours,
Christian

Reply via email to