From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: [Feature Request] - Furigana - Yomigana - Ruby Date: Tue, 28 May 2013 05:34:53 -1000 Message-ID: References: <51A3E117.3000900@gmail.com> <20130528150156.GA19186@kuru.dyndns-at-home.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhLvy-0005tT-0z for emacs-orgmode@gnu.org; Tue, 28 May 2013 11:35:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhLvq-0001TX-5z for emacs-orgmode@gnu.org; Tue, 28 May 2013 11:35:33 -0400 Received: from oproxy6-pub.bluehost.com ([67.222.54.6]:42471) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1UhLvp-0001Sk-W6 for emacs-orgmode@gnu.org; Tue, 28 May 2013 11:35:26 -0400 In-Reply-To: <20130528150156.GA19186@kuru.dyndns-at-home.com> (Suvayu Ali's message of "Tue, 28 May 2013 17:01:56 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Suvayu Ali Cc: emacs-orgmode@gnu.org Suvayu Ali writes: > On Tue, May 28, 2013 at 03:00:40PM +0200, Torsten Wagner wrote: >>=20 >> However, I believe that for many users, the special cases are not very >> frequent and complex. Might it be possible to create a very simple syntax >> for exporting rules which could be either in those above modules or >> directly within the file written by the user themself? >>=20 >> #+HTML_USER_RULE \ruby{$1}{$2}, $1 >> ($2) <\ruby> > > Isn't this very similar to a #+MACRO definition but with a different > syntax and only for the HTML backend? > > Maybe we could allow backend specific macro expansion definitions. > Something like: > > #+HTML_MACRO: ruby $1 ($2) <\ruby> > #+LATEX_MACRO: ruby \ruby{$1}{$2} > > Then {{{ruby(=E6=9D=B1,=E3=81=B2=E3=81=8C=E3=81=97)}}} will be expanded= appropriately for > different backends. > > What do you think? > > Cheers, > > PS: Actually on second thought it is probably possible to handle this > with filters although I failed to find the appropriate filter. > > So you could try: > > #+MACRO: ruby <$1><$2> > > And the filter can translate the cookie to the appropriate backend > specific expansion. Another option would be a link: (org-add-link-type "ruby" nil (lambda (path desc format) (cond ((eq format 'html) (format " %s (%s) <\ruby>" path des= c)) ((memq format '(beamer latex)) (format "\\ruby{%s}{%s}" path desc))))) [[ruby:=E6=9D=B1][=E3=81=B2=E3=81=8C=E3=81=97]] (untested) All the best, Tom --=20 Thomas S. Dye http://www.tsdye.com