From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/29106 Path: news.gmane.org!not-for-mail From: Taco Hoekwater Newsgroups: gmane.comp.tex.context Subject: Re: small caps italic and font switching inside math Date: Sun, 02 Jul 2006 16:16:36 +0200 Message-ID: <44A7D544.8010301@elvenkind.com> References: <6faad9f00606281044v65d247fayc9abef39f77d7029@mail.gmail.com> <44A2D0F9.4020407@elvenkind.com> <6faad9f00606281911x6ca20768x258f2121379b5557@mail.gmail.com> <44A38041.4040907@elvenkind.com> <44A3817F.4040804@elvenkind.com> <6faad9f00606302050t25a91ac0w52bfa8c7f8f189c6@mail.gmail.com> <44A61BB5.7090302@elvenkind.com> <6faad9f00607011224l12156860we1f64cdbaa81e25b@mail.gmail.com> <44A78767.2000803@elvenkind.com> <6faad9f00607020459g27a9c66dteac6f4ca1474ddb4@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1151849910 10608 80.91.229.2 (2 Jul 2006 14:18:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 2 Jul 2006 14:18:30 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sun Jul 02 16:18:28 2006 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 ciao.gmane.org with esmtp (Exim 4.43) id 1Fx2mK-0006WL-9e for gctc-ntg-context-518@m.gmane.org; Sun, 02 Jul 2006 16:18:28 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 597B8127BB; Sun, 2 Jul 2006 16:18:28 +0200 (CEST) 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 18352-05; Sun, 2 Jul 2006 16:18:28 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3A15112805; Sun, 2 Jul 2006 16:16:39 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9381E12805 for ; Sun, 2 Jul 2006 16:16:38 +0200 (CEST) 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 18225-05 for ; Sun, 2 Jul 2006 16:16:37 +0200 (CEST) Original-Received: from post-23.mail.nl.demon.net (post-23.mail.nl.demon.net [194.159.73.193]) by ronja.ntg.nl (Postfix) with SMTP id 2B52E127BB for ; Sun, 2 Jul 2006 16:16:37 +0200 (CEST) Original-Received: from boo.demon.nl ([82.161.175.147]:42228 helo=[10.10.0.3]) by post-23.mail.nl.demon.net with esmtp (Exim 4.51) id 1Fx2kW-000ICr-F8 for ntg-context@ntg.nl; Sun, 02 Jul 2006 14:16:36 +0000 User-Agent: Mozilla Thunderbird 1.0.6-7.6.20060mdk (X11/20050322) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <6faad9f00607020459g27a9c66dteac6f4ca1474ddb4@mail.gmail.com> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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:29106 Archived-At: Mojca Miklavec wrote: > > > Seems like understanding \expandafter would solve 90% of my problems. > I tried to understand that part in TeX book, but it's so cryptic (too > short) ... I understand the concept, but I'm not able to write the > code for it yet :( The trick to \expandafter is that you (normally) write it backwards until reaching a moment in time where TeX is not scanning an argument. Say you have a macro that contains some stuff in it to be typeset by \type: \def\mystuff{Some literal stuff} Then you begin with \type{\mystuff} but that obviously doesn't work, you want the final input to look like \type{Some literal stuff} Since \expandafter expands the token that follows the after next token -- whatever the next token is -- you have to insert it backwards across the opening brace of the argument, like so: \type\expandafter{\mystuff} But this wouldn't work, yet: you are still in the middle of an expression (the \type expects an argument, and it gets \expandafter as it stands). Luckily, \expandafter *itself* is an expandable command, so you jump back once more and insert another one: \expandafter\type\expandafter{\mystuff} Now you are on 'neutral ground', and can stop backtracking. Easy, once you get the hang of it. Taco