From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/63629 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: \definenamespace (was: The visual counter module) Date: Wed, 17 Nov 2010 22:53:20 +0100 Message-ID: <8B256D52-298A-462A-9BDD-BBC4A5BF3B67@gmail.com> References: <20101117191032.GD20635@aides> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1290030855 29408 80.91.229.12 (17 Nov 2010 21:54:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 17 Nov 2010 21:54:15 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Nov 17 22:54:10 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PIpx8-0006II-JD for gctc-ntg-context-518@m.gmane.org; Wed, 17 Nov 2010 22:54:06 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 30875CA82E; Wed, 17 Nov 2010 22:54:05 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id AckwYM-iV10M; Wed, 17 Nov 2010 22:54:02 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5C1DBCA83A; Wed, 17 Nov 2010 22:54:02 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8C542CA83A for ; Wed, 17 Nov 2010 22:54:00 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id okj6k6+SHIFL for ; Wed, 17 Nov 2010 22:53:57 +0100 (CET) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id CE03CCA82E for ; Wed, 17 Nov 2010 22:53:57 +0100 (CET) Original-Received: from mail-fx0-f41.google.com (mail-fx0-f41.google.com [209.85.161.41]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oAHLruEB028006 for ; Wed, 17 Nov 2010 22:53:57 +0100 Original-Received: by fxm20 with SMTP id 20so1028411fxm.14 for ; Wed, 17 Nov 2010 13:53:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=RrlmkNcwIxg2XepkujTSJNhRDO9CNu5dEkchU5Q59Bo=; b=jBexViQs3BlIyhNPG4XycBjLUdU7Ax+Cmz0F5zjWxWeH9nWDV9k6Dl/uQ7oSqhW8oP frOf5Wjk1mJeXDkF1+2vfbndJnNbMbsiD4mU+Hv+P6MeeguiS1fuqUOBoPJLwWoHesdH q3TXeGt4fF4WZpgS4opVjzE2rTqSjn4efR6Uw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=thtd509iZxFDdzVZaVgTMFeonNIquTh9x+1RR0r0XQWC0Sf2+xQP6pmLnzIuABqB4t bMslTqCL/K8vntJ7yfWxDk9pnWAAbnqCY/VdCoVBgJss3wHIBVCFxh7tEYscXS3qW6rz C8RzszNpqqbyd/Me7g2DDFKH/VLwt7McBKjls= Original-Received: by 10.223.115.203 with SMTP id j11mr7492593faq.35.1290030836710; Wed, 17 Nov 2010 13:53:56 -0800 (PST) Original-Received: from [192.168.2.23] (p5B29523A.dip.t-dialin.net [91.41.82.58]) by mx.google.com with ESMTPS id c10sm295738fat.6.2010.11.17.13.53.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 17 Nov 2010 13:53:55 -0800 (PST) In-Reply-To: <20101117191032.GD20635@aides> X-Mailer: Apple Mail (2.1082) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.41; 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: 0eDwlRVsP - 44a6eb6654f5 - 20101117 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:63629 Archived-At: Am 17.11.2010 um 20:10 schrieb Philipp Gesang: > Hi Aditya, > = > you seem to be familiar with some of the features of the new > namespace model that I was not able to infer from Wolfgang=92s > code. Could you please comment on what the keys =91setup=92, =91type=92, > and =91command=92 in =91\definenamespace=92 accomplish? I=92m not Aditya but i hope you will also accept my explanation. I will start with the first argument and the =84type=93 key, e.g. \definenamespace [fancybreak] [type=3Dmodule] will produce the namespace =84@@@@fancybreak=93 with the short form (the name itself has the same length but for TeX it=92s only a single tokens instead of many with the @@@@... form) \????fancybreak. The is currently only one argument with the name =84module=93 but another one like =84core=93 or =84base=93 can appear in the future but this will be then reserved for Hans to replace the \definesystemvariable command from the core to produce a namespace in the form =84@@xx=93. When you define a namespace you should use three or more letters because two letter namespaces are reserved for Hans itself, e.g. is already used by the database module. The second key you need is =84name=93 because it=92s argument is used when all the =84\setup...=93 and =84\define...=93 commands are created. The key =84style=93 creates the command =84\dosetattributes=93 which takes two arguments where the first is to change the style (font) in your new created command and the second for the color. The setup \definenamespace [fancybreak] [type=3Dmodule, name=3Dfancybreak, style=3Dyes] creates the command \dosetfancybreakattributes which can be used like \dosetfancybreakattributes\c!style\c!color and will take the =84style=93 and =84color=93 argument from the \setupfancybreak command. The setup key creates the command =84\setup=93 where you can control whether the commands accepts a list of environment in the two argument form or only a single environment, e.g. =84setup=3Dyes=93 let you write \setupfancybreak[one][..,..=3D..,..] and \setupfancybreak[..,..=3D..,..] while =84setup=3Dlist=93 let you use \setupfancybreak[one,two][..,..=3D..,..] and \setupfancybreak[..,..=3D..,..] The key =93command=93 creates a bunch of macros, besides the =84\define...= =93 commands to create new environment and commands with your code it creates the following macros to access the values from your setup commands: - \parameter - \namedparameter - \detokenizedparameter The command key has like the setup key the two values yes and list, with =84command=3Dyes=93 you can write \define[one][..,..=3D..,..] or (clone a setup like \definehead[mysection][section]) \define[two][one] while =84command=3Dlist=93 allows \define[one,two][..,..=3D..,..] or \define[two,three][one] For parent it=92s the best to give as argument always the same value as you defined for the namespace, e.g. for the fancybreak module one should write =84parent=3Dfancybreak=93. Wolfgang ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________