emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tsd@tsdye.com (Thomas S. Dye)
To: Suvayu Ali <fatkasuvayu+linux@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [Feature Request] - Furigana - Yomigana - Ruby
Date: Tue, 28 May 2013 05:34:53 -1000	[thread overview]
Message-ID: <m1a9nf15k2.fsf@poto.westell.com> (raw)
In-Reply-To: <20130528150156.GA19186@kuru.dyndns-at-home.com> (Suvayu Ali's message of "Tue, 28 May 2013 17:01:56 +0200")

Suvayu Ali <fatkasuvayu+linux@gmail.com> writes:

> On Tue, May 28, 2013 at 03:00:40PM +0200, Torsten Wagner wrote:
>> 
>> 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?
>> 
>> #+HTML_USER_RULE \ruby{$1}{$2}, <ruby> $1
>> <rp>(</rp><rt>$2</rt><rp>)</rp> <\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 <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?
>
> 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 <cookie><$1><$2></cookie>
>
>     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 "<ruby> %s <rp>(</rp><rt>%s</rt><rp>)</rp> <\ruby>" path desc))
      ((memq format '(beamer latex))
           (format "\\ruby{%s}{%s}" path desc)))))


[[ruby:東][ひがし]]

(untested)

All the best,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com

  parent reply	other threads:[~2013-05-28 15:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-27 22:41 [Feature Request] - Furigana - Yomigana - Ruby T.T.N.
2013-05-28 13:00 ` Torsten Wagner
2013-05-28 15:01   ` Suvayu Ali
2013-05-28 15:27     ` Suvayu Ali
2013-05-28 15:34     ` Thomas S. Dye [this message]
2013-05-29  7:20     ` Christian Moe
2013-05-29  7:30       ` Suvayu Ali
2013-05-28 15:43   ` Tristan Nakagawa
2013-05-28 17:36     ` Torsten Wagner
2013-05-29 15:20       ` Tristan Nakagawa
2013-05-29 16:46         ` Christian Moe
2013-05-29 18:15           ` Suvayu Ali
2013-05-29 18:13         ` Suvayu Ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1a9nf15k2.fsf@poto.westell.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=fatkasuvayu+linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).