From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/47654 Path: news.gmane.org!not-for-mail From: Mojca Miklavec Newsgroups: gmane.comp.tex.context Subject: Re: Taco's \molecule fails in mkiv Date: Mon, 23 Feb 2009 18:14:08 +0100 Message-ID: <6faad9f00902230914s502988d0pfc7cbc2f01ce570@mail.gmail.com> References: <6faad9f00902230821t6811fff4t4bc868c3e3f2999c@mail.gmail.com> <6D3CC355-796C-4E13-9CE5-0DF668E0439E@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1235409379 6609 80.91.229.12 (23 Feb 2009 17:16:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Feb 2009 17:16:19 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Feb 23 18:17:32 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 1LbeQn-0004r5-A0 for gctc-ntg-context-518@m.gmane.org; Mon, 23 Feb 2009 18:17:25 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E3C361FCB7; Mon, 23 Feb 2009 18:16:02 +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 05652-06; Mon, 23 Feb 2009 18:14:48 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9ED151FB82; Mon, 23 Feb 2009 18:14:48 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9002A1FB82 for ; Mon, 23 Feb 2009 18:14:47 +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 04845-07-3 for ; Mon, 23 Feb 2009 18:14:10 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by ronja.ntg.nl (Postfix) with ESMTP id 5998A1FB64 for ; Mon, 23 Feb 2009 18:14:10 +0100 (CET) Original-Received: from mail-fx0-f167.google.com (mail-fx0-f167.google.com [209.85.220.167]) by filter2-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n1NHE8RT025829 for ; Mon, 23 Feb 2009 18:14:09 +0100 Original-Received: by fxm11 with SMTP id 11so2124759fxm.2 for ; Mon, 23 Feb 2009 09:14:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=hBEp/E++xnGSFZbXc5BuxSKqCEmXpqX0HW1zDrb/S0c=; b=Itxh/00Az+9s8wStEjb0jTWuP6UDG2XzXzlYflS2Fztsq2MSNJSf2f8RaDOUa0W2RU 3893DqHIeAqFtKB+SHBMyixWKdN5aBs1xtOTtSGB7daMuqr2ogmhNCZOxd60MT6GCP3f 4QTVNR41EZKSD6otDea1yij+Bs5kMOBqRD6Hs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=JUny90CUZv9b5orxWeOOekIcIKjI9m/+4pnHCcAW2XziOizn9TaywaXb6jliNAUfHO R5B9EeHcoXFdgCSimuA7Y5EIJ6VqXoqcUrh8CC5OVgyOMcOhs5fcLdOPwcZZh26Pevbz PnNZfuYy47Kz+X8ywq26h8nyXujdG9Ff6AnKE= Original-Received: by 10.181.226.5 with SMTP id d5mr1588809bkr.116.1235409248567; Mon, 23 Feb 2009 09:14:08 -0800 (PST) In-Reply-To: <6D3CC355-796C-4E13-9CE5-0DF668E0439E@gmail.com> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.220.167; 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: 184066034 - 2865e68320f5 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 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:47654 Archived-At: On Mon, Feb 23, 2009 at 17:52, Wolfgang Schuster wrote: > > Am 23.02.2009 um 17:21 schrieb Mojca Miklavec: > >> Hello, >> >> I did not try to analyze how the following macros work (they are too >> complex), but they somehow fail in mkiv. (I don't need the "F" >> kerning, so that portion of code may go away, but the macro itself is >> very very handy.) >> >> All I want is to have a macro that "converts" _{...} into \low{...} >> and ^{...} into \high{...} (or possibly enable using both at the same >> time). > > \startluacode > > thirddata = thirddata or { } > > function thirddata.molecule(text) > text = string.gsub(text,"_","\\low") > text = string.gsub(text,"%^","\\high") > tex.sprint(text) > end > > \stopluacode > > \def\molecule#1{\ctxlua{thirddata.molecule('#1')}} > > \starttext > \molecule{H_2SO_4} > \molecule{H_2^+} > \stoptext Hello Wolfgang, thanks a lot for the very nice code :) :) :) The second example (H_2^+) does not return expected result - it should have been H\lohi{2}{+} instead, but I don't require such cases for the current document, so I guess that I'll just replace the old macro with this one for now in order not to get distracted with TeX problems too much :) Thanks again, Mojca ___________________________________________________________________________________ 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 ___________________________________________________________________________________