From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/47647 Path: news.gmane.org!not-for-mail From: Mojca Miklavec Newsgroups: gmane.comp.tex.context Subject: Taco's \molecule fails in mkiv Date: Mon, 23 Feb 2009 17:21:41 +0100 Message-ID: <6faad9f00902230821t6811fff4t4bc868c3e3f2999c@mail.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 1235406220 26419 80.91.229.12 (23 Feb 2009 16:23:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Feb 2009 16:23:40 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Feb 23 17:24:55 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 1Lbdby-0000Zb-Ch for gctc-ntg-context-518@m.gmane.org; Mon, 23 Feb 2009 17:24:54 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DB1EB1FB29; Mon, 23 Feb 2009 17:23:31 +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 01916-02; Mon, 23 Feb 2009 17:22:20 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6F4081FADC; Mon, 23 Feb 2009 17:22:20 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8849E1FBBD for ; Mon, 23 Feb 2009 17:22:18 +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 01414-01-5 for ; Mon, 23 Feb 2009 17:21:42 +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 897EB1FBD5 for ; Mon, 23 Feb 2009 17:21:42 +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 n1NGLfeJ019673 for ; Mon, 23 Feb 2009 17:21:41 +0100 Original-Received: by fxm11 with SMTP id 11so2063377fxm.2 for ; Mon, 23 Feb 2009 08:21:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=O9MPmugyF6fMsw05wA5WtEhJSZ015PeAjY9JsanbchY=; b=pJh2nP8nxEQuBXkNZessejmdNNAHQeQ+XYTxQcT4qpT3y3GkyEiBphuTDINT5c7G6u hTMr/Q9IcMctotvfxhq4aa+0fJ/FADDh1UAlLYb0vCsh8VKdTFzcgwPj/DmppcRs6Maa LW/CUk0uyldGILU3ONyB79N1ISrXOtaG4Yvr8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=swKX6mv3xESejqkt7JaE3dYmhCZKnH5g0wqbsqWPgRMgWJJGdNzk+vGB/hOPfoPcCO rIgRvwk/MkfAgMXfR/TLMRVY4G8lrRq1jwTbyaNfw0wL1BXQOZuyJipaU2VHS59fWgjS dvne8a78EQ8NKTVnDFLPmTCqYCdqBVWCoLOQE= Original-Received: by 10.181.147.3 with SMTP id z3mr1582855bkn.17.1235406101204; Mon, 23 Feb 2009 08:21:41 -0800 (PST) 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: 184038692 - 3e6f878270d9 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:47647 Archived-At: 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). \newbox\chemlowbox \def\chemlow#1% {\setbox\chemlowbox\hbox{{\switchtobodyfont[small]#1}}} \def\chemhigh#1% {\ifvoid\chemlowbox \high{{\switchtobodyfont[small]#1}}% \else \/\lohi{\box\chemlowbox}{{\switchtobodyfont[small]#1}}\fi } \def\finishchem% {\ifvoid\chemlowbox \else \iffluor \fluorfalse \kern-.1em \fi\low{\box\chemlowbox}\fi} % for "kerning" after F \newif\iffluor \unexpanded\def\molecule% {\bgroup \catcode`\_=\active \uccode`\~=`\_ \uppercase{\let~\chemlow}% \catcode`\^=\active \uccode`\~=`\^ \uppercase{\let~\chemhigh}% \dostepwiserecurse {65}{90}{1} {\catcode \recurselevel = \active \uccode`\~=\recurselevel \uppercase{\edef~{\noexpand\finishchem \rawcharacter{\recurselevel}}}}% \uccode `\~=`\F \uppercase{\def~{\finishchem F\fluortrue}}% \catcode`\-=\active \uccode`\~=`\- \uppercase{\def~{--}}% %\loggingall \domolecule }% \def\domolecule#1% {\expandafter\scantokens\expandafter {\detokenize{#1\finishchem}}\egroup} \starttext \molecule{CO_2} \stoptext Thanks for any hints, 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 ___________________________________________________________________________________