From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/38276 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: conditionals and font switches Date: Tue, 25 Dec 2007 20:21:18 +0100 Message-ID: <20071225202118.9ec7582b.schuster.wolfgang@googlemail.com> References: 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 1198610577 31867 80.91.229.12 (25 Dec 2007 19:22:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Dec 2007 19:22:57 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Dec 25 20:23:09 2007 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 1J7FMo-0006TY-GC for gctc-ntg-context-518@m.gmane.org; Tue, 25 Dec 2007 20:23:06 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8F2021FBBA; Tue, 25 Dec 2007 20:22:42 +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 11991-10; Tue, 25 Dec 2007 20:22:04 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 474F11FB7E; Tue, 25 Dec 2007 20:22:04 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3178A1FB7E for ; Tue, 25 Dec 2007 20:22:03 +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 12022-02-2 for ; Tue, 25 Dec 2007 20:21:28 +0100 (CET) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by ronja.ntg.nl (Postfix) with ESMTP id 795461FB71 for ; Tue, 25 Dec 2007 20:21:28 +0100 (CET) Original-Received: by fg-out-1718.google.com with SMTP id e12so1327887fga.8 for ; Tue, 25 Dec 2007 11:21:28 -0800 (PST) Original-Received: by 10.86.100.7 with SMTP id x7mr5857048fgb.7.1198610488206; Tue, 25 Dec 2007 11:21:28 -0800 (PST) Original-Received: from rover ( [84.149.72.111]) by mx.google.com with ESMTPS id 3sm6423709fge.7.2007.12.25.11.21.27 (version=SSLv3 cipher=OTHER); Tue, 25 Dec 2007 11:21:27 -0800 (PST) In-Reply-To: X-Mailer: Sylpheed 2.4.8 (GTK+ 2.10.14; i686-pc-mingw32) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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:38276 Archived-At: On Tue, 25 Dec 2007 11:25:18 -0700 "Idris Samawi Hamid" wrote: > Dear gang, > > Consider a control sequence \MyCS. It has three possible definitions: > > \def\MyCS{}, \def\MyCS{}, \def\MyCS{} > > What I would like is to define \MyCS once such that > > takes effect when \tf is invoked > takes effect when \it is invoked > takes effect when \bf is invoked > > something like (incorrect syntax but you'll get the point) > > \def\MyCS{% > \if\it > \else > \if\bf > \else > } > > How can I do this> Any tips greatly appreciated! > > Happy Holidays! > Idris You could modify the following macro from font-ini. \def\fontstylesuffix {\ifx\fontalternative\c!tf \s!Regular \else \ifx\fontalternative\c!bf \s!Bold \else \ifx\fontalternative\c!sl \s!Slanted \else \ifx\fontalternative\c!it \s!Italic \else \ifx\fontalternative\c!bs \s!BoldSlanted \else \ifx\fontalternative\c!bi \s!BoldItalic \else \ifx\fontalternative\c!sc \s!Caps \else \s!Regular \fi\fi\fi\fi\fi\fi\fi}% Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________