From mboxrd@z Thu Jan 1 00:00:00 1970 From: Suvayu Ali Subject: Re: [Feature Request] - Furigana - Yomigana - Ruby Date: Tue, 28 May 2013 17:27:02 +0200 Message-ID: <20130528152702.GB19186@kuru.dyndns-at-home.com> References: <51A3E117.3000900@gmail.com> <20130528150156.GA19186@kuru.dyndns-at-home.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhLnw-0002uJ-Lo for emacs-orgmode@gnu.org; Tue, 28 May 2013 11:27:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhLnn-0006hd-81 for emacs-orgmode@gnu.org; Tue, 28 May 2013 11:27:16 -0400 Received: from mail-wg0-x231.google.com ([2a00:1450:400c:c00::231]:60968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhLnn-0006hR-2J for emacs-orgmode@gnu.org; Tue, 28 May 2013 11:27:07 -0400 Received: by mail-wg0-f49.google.com with SMTP id y10so5369928wgg.4 for ; Tue, 28 May 2013 08:27:06 -0700 (PDT) Received: from kuru.dyndns-at-home.com ([2001:610:120:3000:f2de:f1ff:fe37:c76c]) by mx.google.com with ESMTPSA id cw8sm25001212wib.7.2013.05.28.08.27.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 28 May 2013 08:27:05 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20130528150156.GA19186@kuru.dyndns-at-home.com> 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: emacs-orgmode@gnu.org On Tue, May 28, 2013 at 05:01:56PM +0200, Suvayu Ali wrote: > > 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. Maybe this will work (untested): org-export-filter-paragraph-functions. The assumption is you will use the macro by itself in a paragraph and not on structural elements like headlines. (defun sa-latex-subscript (contents backend info) (when (eq backend 'latex) (replace-regexp-in-string "<\\([^>]+\\)><\\([^>]+\\)>" "\\\\ruby{\\1}{\\2}" contents)) (when (eq backend 'html) (replace-regexp-in-string "<\\([^>]+\\)><\\([^>]+\\)>" "\\1(\\2) <\ruby>" contents))) I did not check the regular expressions at all, so please test and let us know. Cheers, -- Suvayu Open source is the future. It sets us free.