From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/48488 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: pinyin in context Date: Tue, 17 Mar 2009 22:47:41 +0100 Message-ID: References: <20090311044449.GA10316@localhost.localdomain> <20090315031958.GA8541@localhost.localdomain> <0F0A9C5F-CC0E-4B0F-AC00-B9189287F00D@gmail.com> <20090316161752.GA7694@localhost.localdomain> <393BDFEF-92DA-47FF-90AA-E90632F268F7@gmail.com> <20090317212219.GA11557@localhost.localdomain> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: multipart/mixed; boundary=Apple-Mail-9--826259754 X-Trace: ger.gmane.org 1237326572 23766 80.91.229.12 (17 Mar 2009 21:49:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Mar 2009 21:49:32 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Mar 17 22:50:49 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1LjhBN-0006OG-6p for gctc-ntg-context-518@m.gmane.org; Tue, 17 Mar 2009 22:50:45 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E3A4A1FD37; Tue, 17 Mar 2009 22:49:20 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 16430-07; Tue, 17 Mar 2009 22:48:38 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id AFDDE1FCD3; Tue, 17 Mar 2009 22:48:38 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 720FD1FCD3 for ; Tue, 17 Mar 2009 22:48:37 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01724-02-6 for ; Tue, 17 Mar 2009 22:48:30 +0100 (CET) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by ronja.ntg.nl (Postfix) with ESMTP id EE20D1FCD0 for ; Tue, 17 Mar 2009 22:48:29 +0100 (CET) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by filter3-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n2HLmRmt020019 for ; Tue, 17 Mar 2009 22:48:28 +0100 Original-Received: by fg-out-1718.google.com with SMTP id l27so22380fgb.8 for ; Tue, 17 Mar 2009 14:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:mime-version:subject:date:references :x-mailer; bh=BU2B4Ns7IK9SA+vtnKw7PiClDNv1l5G8K3WDW/x+40U=; b=F1zvJF36S7cUoCqUwQy1wgBFIXEA4oICEmmEAwEED+jLs+fF6St8KjbgqdONf5KU5l q3gxaYaEvKDEEFZWM1GI4bzFfkS+zebgQEyqQm9NIseMenVtl3gUAe7CRiu3tRS1PsS+ QMq69Ad7hsy9md24hogr0KFXLUTJ2Od9vwcas= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; b=j47mpcS+yY8YQah7+WUiHwsgS+0s8BhbWdVEYrVartGaU0YfQ93F2TrhILezSUEudD P5TUYAkexZvrvjzLLMvw3jzB5gTMLhLNkm9FqKNXofY2vtUZ1YqZJWWAW7dZZ+7CGsPa /j5WY1p0YkH8vhgIjtUsqhcx3vl7psEh8VR50= Original-Received: by 10.86.95.8 with SMTP id s8mr158055fgb.79.1237326507803; Tue, 17 Mar 2009 14:48:27 -0700 (PDT) Original-Received: from ?10.40.42.168? ([82.113.121.146]) by mx.google.com with ESMTPS id l12sm919815fgb.11.2009.03.17.14.48.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 17 Mar 2009 14:48:26 -0700 (PDT) In-Reply-To: <20090317212219.GA11557@localhost.localdomain> X-Mailer: Apple Mail (2.930.3) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=72.14.220.158; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 195153476 - b8e88a7ae7a8 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:48488 Archived-At: --Apple-Mail-9--826259754 Content-Disposition: attachment; filename=wolf-newjap.tex Content-Type: application/octet-stream; x-unix-mode=0755; name="wolf-newjap.tex" Content-Transfer-Encoding: 7bit %D \module %D [ file=wolf-jap, %D version=20xx.xx.xx, %D title=\CONTEXT\ User Module, %D subtitle=Japanese, %D author=Wolfgang Schuster, %D date=\currentdate, %D copyright=Wolfgang Schuster] \unprotect \startconstants all overhang: overhang \stopconstants \def\????rb{@@@@rb} \newdimen\rubywidth \newsignal\rubysignal \def\setupruby {\dodoubleargument\getparameters[\????rb]} \def\startRUBY {\dosingleempty\dostartRUBY} \def\dostartRUBY[#1]% {\dontleavehmode \bgroup \iffirstargument \setupruby[#1]% \fi \ifdim\lastskip=\rubysignal \def\@@@@rboverhang{no}% \fi} \def\startRB#1\stopRB {\setbox1=\hbox{#1}} \def\startRT#1\stopRT {\setbox0=\hbox{#1}} \def\stopRUBY {\dimen0=\wd0 \multiply\dimen0 by\@@@@rbscale \divide\dimen0 by 1000 \dimen1=\wd1 \ifdim\dimen0>\dimen1 \ifx\@@@@rboverhang\v!yes \rubywidth=\dimen1 \else \rubywidth=\dimen0 \fi \else \rubywidth=\dimen1 \fi \vbox {\hbox\!!to\rubywidth %{\hss\switchtobodyfont[\dimexpr\@@@@rbscale\bodyfontsize\relax]\box0\hss} {\hss\box0\hss}% \hbox\!!to\rubywidth{\hss\small\box1\hss}}% \egroup \hskip\rubysignal} \setupruby [align=middle, overhang=yes, scale=500] \protect \endinput --Apple-Mail-9--826259754 Content-Disposition: attachment; filename=wolf-jap.tex Content-Type: application/octet-stream; x-unix-mode=0755; name="wolf-jap.tex" Content-Transfer-Encoding: quoted-printable %D=20\module=0A%D=20=20=20[=20=20=20=20=20=20=20file=3Dwolf-jap,=0A%D=20=20= =20=20=20=20=20=20version=3D20xx.xx.xx,=0A%D=20=20=20=20=20=20=20=20=20=20= title=3D\CONTEXT\=20User=20Module,=0A%D=20=20=20=20=20=20=20= subtitle=3DJapanese,=0A%D=20=20=20=20=20=20=20=20=20author=3DWolfgang=20= Schuster,=0A%D=20=20=20=20=20=20=20=20=20=20=20date=3D\currentdate,=0A%D=20= =20=20=20=20=20copyright=3DWolfgang=20Schuster]=0A=0A= \writestatus{loading}{Context=20User=20Module=20/=20Japanese}=0A=0A= \unprotect=0A=0A%D=20Systemvariable=0A=0A\def\????rb{@@@@rb}=20%=20RuBy=0A= =0A%D=20Setup=20for=20rubyenvironment=0A=0A\def\setupruby%=0A=20=20= {\dosingleempty\dosetupruby}=0A=0A\def\dosetupruby[#1]%=0A=20=20= {\getparameters[\????rb][#1]}=0A=0A%D=20Ruby=20definition=0A=0A= \def\ruby%=0A=20=20{\dosingleempty\doruby}=0A=0A\def\doruby[#1]#2#3%=20= Zeichen=20unter=20Rubybase=20im=20Moment=20nicht=20unterst=FCtzt=0A=20=20= {\dontleavehmode=0A=20=20=20\bgroup=0A=20=20=20= \getparameters[\????rb][#1]%=0A=20=20=20\offinterlineskip=0A=20=20=20= \edef\localstrut{\@@@@rbstrut}%=0A=20=20=20\edef\rubysize=20=20= {\switchtobodyfont[\the\dimexpr\@@@@rbscale\bodyfontsize\relax]}%=0A=20=20= =20\setbox0=3D\hbox{#2}\dimen0=3D\wd0=0A=20=20=20= \setbox1=3D\hbox{\rubysize#3}\dimen1=3D\wd1=0A=20=20=20= \ifdim\dimen0>\dimen1=0A=20=20=20=20=20\hbox=20to=20\dimen0=0A=20=20=20=20= =20=20=20{\vbox=0A=20=20=20=20=20=20=20=20=20=20{\hbox=20to=20= \dimen0{\hss\ifx\localstrut\v!yes\strut\fi\box1\hss}=0A=20=20=20=20=20=20= =20=20=20=20=20\doifvalue{\@@@@rbdistance}{\vskip\@@@@rbdistance}=0A=20=20= =20=20=20=20=20=20=20=20=20= \hbox{\ifx\localstrut\v!yes\strut\fi\box0}}}\space%=0A=20=20=20\else=0A=20= =20=20=20=20%\hbox=20to=20\dimen1=0A=20=20=20=20=20%=20=20{\vbox=0A=20=20= =20=20=20%=20=20=20=20=20{\hbox{\box1}=0A=20=20=20=20=20%=20=20=20=20=20=20= \vskip-0.7ex=0A=20=20=20=20=20%=20=20=20=20=20=20\hbox=20to=20= \dimen1{\hss\ifx\localstrut\v!yes\strut\fi\box0\hss}}}%=0A=20=20=20=20=20= \hbox=20to=20\dimen0=0A=20=20=20=20=20=20=20{\vbox=0A=20=20=20=20=20=20=20= =20=20=20{\hbox=20to=20= \dimen0{\rubysize\hss\ifx\localstrut\v!yes\strut\fi\box1\hss}=0A=20=20=20= =20=20=20=20=20=20=20=20= \doifvalue{\@@@@rbdistance}{\vskip\@@@@rbdistance}=0A=20=20=20=20=20=20=20= =20=20=20=20\hbox{\ifx\localstrut\v!yes\strut\fi\box0}}}\space%=0A=20=20=20= \fi=0A=20=20=20\egroup=0A=20=20=20\ignorespaces}=0A=0A%D=20A=20few=20= examples=0A%D=0A%D=20Text=20text=20text=0A%D=20\ruby{ruby=20base}{ruby=20= text}=0A%D=20text=20text=20text=0A%D=20= \ruby[scale=3D0.7,strut=3Dno,distance=3D]{ruby=20base}{ruby=20text}=0A%D=20= text=20text=20text=0A%D=20=0A%D=20Text=20text=20text=0A%D=20\ruby{ruby=20= base}{ruby=20text}=0A%D=20text=20text=20text=0A%D=20\ruby[strut=3Dno]{ruby= =20base}{ruby=20text}=0A%D=20text=20text=20text=0A%D=20=0A%D=20Text=20= text=20text=0A%D=20\ruby{ruby=20base}{very=20long=20ruby=20text}=0A%D=20= text=20text=20text=0A%D=20\ruby[scale=3D0.8,strut=3Dno,distance=3D]{ruby=20= base}{very=20long=20ruby=20text}=0A%D=20text=20text=20text=0A=0A%D=20= Default=20values=0A=0A\setupruby=0A=20=20[\c!distance=3D-0.7ex,=0A=20=20=20= \c!scale=3D0.6,=0A=20=20=20\c!strut=3D\v!yes]=0A=0A\protect=20\endinput=0A= --Apple-Mail-9--826259754 Content-Disposition: attachment; filename=js-ruby.tex Content-Type: application/octet-stream; x-unix-mode=0755; name="js-ruby.tex" Content-Transfer-Encoding: 7bit \def\rubyfont{\rm} \newtoks\rubybase \newtoks\rubytext \newdimen\rubywidth \def\startRUBY {\bgroup} \def\stopRUBY {\setbox0\hbox{\rubyfont\strut\the\rubytext\unskip}% \setbox1\hbox{\strut\the\rubybase\unskip}% \ifdim\wd0>\wd1 \rubywidth\wd0 \else \rubywidth\wd1 \fi \vbox {\offinterlineskip \hbox to\rubywidth{\hss\box0\hss}% \hbox to\rubywidth{\hss\box1\hss}}% \egroup} \def\startRB#1\stopRB{\rubybase{#1}} \def\startRT#1\stopRT{\rubytext{#1}} \def\ruby#1#2% {\startRUBY \startRB#1\stopRB \startRT#2\stopRT \stopRUBY} \endinput --Apple-Mail-9--826259754 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Am 17.03.2009 um 22:22 schrieb Bill Long: > In fact, 2 features I need, > > 1. the easy way to support PinYin, both input and the format, As I > mentioned, I hope the pinyin can be placed over the Chinese > character it represented automatically with some environment or > so. I attached a few old files I used to simple ruby texts but none of them is a perfect solution, if you get a proper macro it should support complex and simple ruby. > 2. automatic convert/add pinyin to Chinese Character , now I use > sed to make, but I still hope there are some more easy way. Arthur list can be used for this but you still ned markup to show which characters need reading and then you could also use a ruby command. Wolfgang --Apple-Mail-9--826259754 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --Apple-Mail-9--826259754--