From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/63684 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: \definenamespace (was: The visual counter module) Date: Thu, 18 Nov 2010 16:20:35 -0500 (EST) Message-ID: References: <20101117191032.GD20635@aides> <8B256D52-298A-462A-9BDD-BBC4A5BF3B67@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-1649906530-1290115237=:10790" X-Trace: dough.gmane.org 1290115262 7329 80.91.229.12 (18 Nov 2010 21:21:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 18 Nov 2010 21:21:02 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Nov 18 22:20:57 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 1PJBuT-0000Z1-HW for gctc-ntg-context-518@m.gmane.org; Thu, 18 Nov 2010 22:20:49 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5B2A1CA85C; Thu, 18 Nov 2010 22:20:49 +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 k6hQARa1K9z3; Thu, 18 Nov 2010 22:20:48 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2DB8FCA867; Thu, 18 Nov 2010 22:20:46 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D4ED4CA867 for ; Thu, 18 Nov 2010 22:20:44 +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 7yzObLYy98CM for ; Thu, 18 Nov 2010 22:20:42 +0100 (CET) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 89141CA85C for ; Thu, 18 Nov 2010 22:20:42 +0100 (CET) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.12.86]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oAILKeYt009590 for ; Thu, 18 Nov 2010 22:20:41 +0100 Original-Received: FROM [10.0.2.15] (wpa107211.Wireless.McGill.CA [142.157.107.211]) By tombraider.mr.itd.umich.edu ID 4CE598A7.30F59.10343 ; Authuser adityam; 18 Nov 2010 16:20:39 EST In-Reply-To: <8B256D52-298A-462A-9BDD-BBC4A5BF3B67@gmail.com> User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.12.86; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03DwJkECa - 155996ffe1d4 - 20101118 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.72 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:63684 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-1649906530-1290115237=:10790 Content-Type: TEXT/PLAIN; charset=windows-1252; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Wed, 17 Nov 2010, Wolfgang Schuster wrote: > I=92m not Aditya but i hope you will also accept my explanation. This is a much better explanation than I could have written. Just a few=20 points: > 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 whic= h > 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 contro= l > 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..= =2E=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 In order to use these commads, you must set a value for \current.=20 For example, if you have \define[one][width=3D10cm] In order to access the value of width of "one", you must do: \def\current{one} \parameter{width} (I do not remember the distinction between \parameter, \namedparamter, and \detokenizedparameters). > 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] > I did not know that cloning was possible. The \defineenumeration commands= =20 allows for \defineenumeration[new][old][..=3D..] This clones a selected options from old to new (using copyparamters) and=20 then sets the values of the third arguments. Would it make sense to add support for \define[two,three][one][..=3D..]? > > 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. I thought that you have to write "parent=3D\????fancybreak". Aditya --8323328-1649906530-1290115237=:10790 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --8323328-1649906530-1290115237=:10790--